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.
Sometimes NetBeans is locking source code files. This makes that these files cannot be removed/altered by other programs, such as an external CVS program (which gives errors like: "cvs [update aborted]: cannot rename file .new.PanelContainer.java to PanelContainer.java: File exists"). I couldn't detect when NetBeans put a lock on these files (not all source files are locked, just one or two) and it doesn't happen all the time. The only solution to unlock these files is to shut down NetBeans ... I'm using: Windows 2000 SUN JDK 1.4.1 RC NetBeans 3.4 Maarten
*** Issue 27835 has been marked as a duplicate of this issue. ***
This is possible, that files are locked and then cannot be altered in another process, but this should not be forever. This issue was filled against FS library, but problem is probably anywhere else in NB code: in usage of this library. Streams must be closed, that is probably the root of problem. FS library keeps info about opened stream. There is no way, how I could find, where the problem, bevause I don`t know how to reproduce. Because I`m not able to reproduce, then marked WORKSFORME. But you can test it yourself. If problem occures, then try to delete problematic file by means of FS library in IDE (let your test code run in internal execution). If delete fails, then exeception is fired and exception should be annotated with info about guilty code. Then file appropriate bug and attach output of exception.printStackTrace.
see issue 30290
FYI: I experienced similar problem. I was running cvs update from command line and it was failing because it could not create new version of the source file because the current one was locked by some process. There was no other process running then runide.exe. TaskInfo program confirmed me that runide.exe holds lock on the java source file. I think it was Java parser in this case or some similar deamon because no one file was opened in the IDE. Opening Memory Toolbar and forcing IDE to "Garbage Collect" released the locks.
Is this bug really solved? The bug must be somewhere in the parser. I regularly get into this problem also. For instance if we have generated .java files (from one of our modules, writing a complete .java source to an nbDocument and save) and shortly after that try to delete the Java Source via the Explorer, we get the Exception below. Doing a GC before deleting solves the problem. Fri Feb 07 21:23:18 CET 2003: java.lang.Exception: Cannot delete file com/compu ware/coreproject/application/ejb/order1/OrderlineDataObject.java in D:\javaproj\ qa0_23. org.openide.filesystems.FSException: Cannot delete file com/compuware/coreprojec t/application/ejb/order1/OrderlineDataObject.java in D:\javaproj\qa0_23. at org.openide.filesystems.FSException.io(FSException.java:78) at org.openide.filesystems.LocalFileSystem.delete(LocalFileSystem.java:3 21) at org.netbeans.core.ExLocalFileSystem.delete(ExLocalFileSystem.java:75) at org.openide.filesystems.LocalFileSystem$Impl.delete(LocalFileSystem.j ava:659) at org.openide.filesystems.AbstractFileObject.delete(AbstractFileObject. java:480) at org.openide.loaders.FileEntry.delete(FileEntry.java:100) at org.netbeans.modules.java.JavaDataLoader$JavaFileEntry.delete(JavaDat aLoader.java:416) at org.openide.loaders.MultiDataObject.handleDelete(MultiDataObject.java :423) at org.openide.loaders.DataObject$2.run(DataObject.java:524) at org.openide.filesystems.EventControl.runAtomicAction(EventControl.jav a:89) at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:38 8) at org.openide.loaders.DataObject.delete(DataObject.java:522) at org.openide.loaders.DataNode.destroy(DataNode.java:219) at org.openide.nodes.FilterNode.destroy(FilterNode.java:399) [catch] at org.openide.explorer.ExplorerActions$DeleteActionPerformer$DestroyAto mic.invoke(ExplorerActions.java:527) at $Proxy3.run(Unknown Source) at org.openide.filesystems.EventControl.runAtomicAction(EventControl.jav a:89) at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:38 8) at org.openide.explorer.ExplorerActions$DestroyInvoker.run(ExplorerActio ns.java:568) at org.openide.explorer.ExplorerActions$DeleteActionPerformer.doDestroy( ExplorerActions.java:494) at org.openide.explorer.ExplorerActions$DeleteActionPerformer.performAct ion(ExplorerActions.java:463) at org.openide.util.actions.CallbackSystemAction.performAction(CallbackS ystemAction.java:109) at org.openide.util.actions.CallableSystemAction.actionPerformed(Callabl eSystemAction.java:69) at org.netbeans.core.ModuleActions$1.run(ModuleActions.java:105) at org.openide.util.Task.run(Task.java:152) at org.openide.util.RequestProcessor$ProcessorThread.run(RequestProcesso r.java:622) Fri Feb 07 21:23:18 CET 2003: java.lang.Exception: <no message> java.lang.Exception at org.openide.filesystems.StreamPool$NotifyInputStream.<init>(StreamPoo l.java:253) at org.openide.filesystems.StreamPool.createInputStream(StreamPool.java: 58) at org.openide.filesystems.AbstractFileObject.getInputStream(AbstractFil eObject.java:166) at org.netbeans.modules.java.Util.createInputStream(Util.java:559) at org.netbeans.modules.java.Util.createInputStream(Util.java:513) at org.netbeans.modules.java.gj.V8FileEntry.open(V8FileEntry.java:60) at org.netbeans.lib.javac.v8.code.ClassReader.fillIn(ClassReader.java:10 88) at org.netbeans.lib.javac.v8.code.ClassReader.complete(ClassReader.java: 1070) at org.netbeans.modules.java.gj.WeakCompleters$SymbolCompleter.complete( WeakCompleters.java:77) at org.netbeans.lib.javac.v8.code.Symbol.complete(Symbol.java:344) at org.netbeans.lib.javac.v8.code.Symbol$ClassSymbol.complete(Symbol.jav a:641) at org.netbeans.lib.javac.v8.code.Symbol$ClassSymbol.flags(Symbol.java:5 42) at org.netbeans.lib.javac.v8.comp.Attr.attribBase(Attr.java:356) at org.netbeans.lib.javac.v8.comp.Enter$CompleteEnter.attribBase(Enter.j ava:1110) at org.netbeans.lib.javac.v8.comp.Enter$CompleteEnter.complete(Enter.jav a:1004) at org.netbeans.lib.javac.v8.code.Symbol.complete(Symbol.java:344) at org.netbeans.lib.javac.v8.code.Symbol$ClassSymbol.complete(Symbol.jav a:641) at org.netbeans.lib.javac.v8.comp.Enter.main(Enter.java:674) at org.netbeans.modules.java.gj.ParserEngine.attributeTree(ParserEngine. java:181) at org.netbeans.modules.java.gj.ParserEngine.parseObject(ParserEngine.ja va:151) at org.netbeans.modules.java.gj.JavaParserEngine.process(JavaParserEngin e.java:107) at org.netbeans.modules.java.parser.ParsingSupport$Processor.process(Par singSupport.java:690) at org.netbeans.modules.java.parser.ParsingSupport$Processor.parseLockMo del(ParsingSupport.java:650) [catch] at org.netbeans.modules.java.parser.ParsingSupport$Processor.run(Parsing Support.java:585) at org.openide.util.Task.run(Task.java:152) at org.openide.util.RequestProcessor$ProcessorThread.run(RequestProcesso r.java:622)
reopen -> duplicate
*** This issue has been marked as a duplicate of 29306 ***
verified, closed - it's duplicate.