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 155037 - org.openide.filesystems.FileAlreadyLockedException: /tmp/autoproject-dummy-suite/nbproject/project.properties
Summary: org.openide.filesystems.FileAlreadyLockedException: /tmp/autoproject-dummy-su...
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on: 169078
Blocks: 137947
  Show dependency tree
 
Reported: 2008-12-09 15:31 UTC by Jesse Glick
Modified: 2009-07-24 17:43 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 144137


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2008-12-09 15:31:53 UTC
Build: NetBeans IDE Dev (Build 081208)
VM: Java HotSpot(TM) Client VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03
OS: Linux, 2.6.27-9-generic, i386

User Comments:
jglick: Adding a module to a suite when $suite/nbproject/project.properties was already open (perhaps modified?) in the editor.



Stacktrace: 
org.openide.filesystems.FileAlreadyLockedException: /tmp/autoproject-dummy-suite/nbproject/project.properties
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.registerLock(LockForFile.java:111)
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.tryLock(LockForFile.java:100)
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.lock(FileObj.java:277)
        at org.netbeans.spi.project.support.ant.ProjectProperties$PP$1.run(ProjectProperties.java:240)
        at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:120)
        at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:502)
Comment 1 Jiri Skrivanek 2008-12-09 15:51:46 UTC
Yes, it is locked by editor (see "Locked by" stack trace).
Comment 2 Milan Kubec 2009-07-01 12:09:48 UTC
Jesse, isn't this related to issue #137947?
Comment 3 Jesse Glick 2009-07-01 15:12:01 UTC
Might be. In the last stack trace (anonymous), it looks like
j2ee.sun.ide.j2ee.ModuleConfigurationImpl$StaticBuildExtensionListener.rewriteBuildImpl is triggering a reentrant
project save request. Perhaps FileEvent.firedFrom is not correctly reporting true when called from inside that same AA?
Should be testable at least.

tboudreau's case "Removed a library from a J2SE project which was referenced from nbproject/private/private.properties
while that file was open and modified in the editor" is simply unsupportable; you have to save the file before you can
make changes from other parts of the GUI. My case might have been similar according to the stack trace, and
andrewmigliore's too (though using third-party JVI which might have its own bugs). For that, may be necessary for
ProjectProperties$PP$1.run to just catch FileAlreadyLockedException and either log at INFO, or attach a localized
annotation so it appears as a polite error message.
Comment 4 Jesse Glick 2009-07-23 23:06:10 UTC
I filed issue #169078 for the reentrant save. For the rest, I am just downgrading to INFO; the file will simply not get
saved and any in-memory data will be discarded. core-main #a67e1b1b08dd
Comment 5 Quality Engineering 2009-07-24 17:43:04 UTC
Integrated into 'main-golden', will be available in build *200907241401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a67e1b1b08dd
User: Jesse Glick <jglick@netbeans.org>
Log: #155037: FALE under some conditions.