This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 136190 - File locking exception when trying to build comp app
Summary: File locking exception when trying to build comp app
Status: VERIFIED FIXED
Alias: None
Product: soa
Classification: Unclassified
Component: Composite Application (show other bugs)
Version: 6.x
Hardware: All Windows Vista
: P1 blocker (vote)
Assignee: Jun Qian
URL:
Keywords:
: 136191 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-30 18:16 UTC by lpolycarpou
Modified: 2008-07-10 17:40 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lpolycarpou 2008-05-30 18:16:26 UTC
I created a new comp app and added a number of BPEL, XSLT and Java EE modules and did a build.  Thereafter, I added
another SQL module and immediately hit build.  From the output window, the build was apparently successful (BUILD
SUCCESSFUL message) but the provider endpoint for the SQL module was not generated wholly and going back over the build
output, we see a file lock exception...  This is trivial to repro using the projects located on SWAN here...

http://wikihome.sfbay.sun.com/fast/attach/Nokia_080310%2Ftmwdemo-moms-compapp.zip 

Validating CompApp project...
Resolving connections...
WARNING: PORT w/o address: {http://com.sun.jbi/sqlse/sqlseengine}sqlMobilitySystemNotifier_sqlsePortType
WARNING: PORT w/o address: {http://com.sun.jbi/sqlse/sqlseengine}sqlUpdateWO_sqlsePortType
WARNING: PORT w/o address: {http://com.sun.jbi/sqlse/sqlseengine}sqlUpdateTT_sqlsePortType
Writing connections out to connections.xml...
Generating Service Assembly jbi.xml...
Merging component projects' catalogs...
Generating Binding Component Service Units...
 creating sun-http-binding.jar
Creating/Updating CASA...
org.openide.filesystems.FileAlreadyLockedException: C:\tmwdemo\BP2\CompositeApp1\src\conf\CompositeApp1.casa
       at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.registerLock(LockForFile.java:108)
       at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.tryLock(LockForFile.java:97)
       at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.lock(FileObj.java:277)
       at org.netbeans.modules.compapp.projects.jbi.descriptor.XmlUtil.writeToFileObject(XmlUtil.java:133)
       at org.netbeans.modules.compapp.projects.jbi.descriptor.XmlUtil.writeToFile(XmlUtil.java:99)
       at org.netbeans.modules.compapp.projects.jbi.anttasks.CasaBuilder.createCasaDocument(CasaBuilder.java:234)
       at org.netbeans.modules.compapp.projects.jbi.anttasks.BuildServiceAssembly.execute(BuildServiceAssembly.java:338)
       at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
       at sun.reflect.GeneratedMethodAccessor236.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
       at org.apache.tools.ant.Task.perform(Task.java:348)
       at org.apache.tools.ant.Target.execute(Target.java:357)
       at org.apache.tools.ant.Target.performTasks(Target.java:385)
       at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
       at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
       at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
       at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
       at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:277)
       at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:460)
       at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
C:\tmwdemo\BP2\CompositeApp1\src\conf\CompositeApp1.casa
Filtering Java EE Endpoints...
Deleting: C:\tmwdemo\BP2\CompositeApp1\build\BCDeployment.jar
Building jar: C:\tmwdemo\BP2\CompositeApp1\dist\CompositeApp1.zip
BUILD SUCCESSFUL (total time: 4 seconds)
Comment 1 Tientien Li 2008-05-30 18:36:48 UTC
*** Issue 136191 has been marked as a duplicate of this issue. ***
Comment 2 Tientien Li 2008-06-02 20:47:08 UTC
Louis,

After some testing of the problem this morning, I think we isolated its cause. There is a bug in CompApp that 
triggered a race condition between NetBeans XML model updating CASA and ant tasks modifying CASA when multiple new 
projects are added in certain combination of projects like this one. We will need to develop a more general design to 
avoid this type of problems.

Before the fix for this problem is implemented, one can work around this problem by either:

1) doing a save of CompApp changes in CASA before build, or
2) build the project again if the first build failed to update SU in CASA

Thanks,

--
Tientien Li
Comment 3 lpolycarpou 2008-06-02 21:04:24 UTC
Thanks for the update.
Comment 4 Jun Qian 2008-06-05 01:41:15 UTC
Fixed in trunk. Changeset: http://hg.netbeans.org/main?cmd=changeset;node=485939a82f62

Comment 5 Quality Engineering 2008-06-05 15:50:58 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #239 build
Changeset: http://hg.netbeans.org/main/rev/485939a82f62
User: Jun Qian <jqian@netbeans.org>
Log: #136190 Fix file lock issue when building compapp project immediately after dropping multiple SU projects into CASA.
Comment 6 Jun Qian 2008-06-10 23:34:05 UTC
I think this should be included in 6.1 patches.
Comment 7 jlautz 2008-06-13 03:06:24 UTC
According to Jun, the simplest test case was simply to add two SUs and then click Build Project to reproduce the race
condition.

I retested this test case using

Product Version: NetBeans IDE Dev (Build 200806111204)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: SunOS version 5.10 running on x86; ISO646-US; en (nb)
Userdir: /Users/lautz/.netbeans/dev

I can no longer reproduce the test case.
Comment 8 pslechta 2008-06-13 10:37:52 UTC
The fix has been ported into the release61_fixes repository.

http://hg.netbeans.org/release61_fixes/rev/29c96a215209