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.
I have several JAR files mounted in Filesystems tab of Explorer panel. As soon as I open/expand one of those nodes (browse classes inside) the JAR file becomes locked and cannot be deleted afterwards until I either open a different project or close NetBeans. This even happens if one collapses all children of the node corresponding to the JAR file.
*** Issue 20952 has been marked as a duplicate of this issue. ***
*** Issue 21803 has been marked as a duplicate of this issue. ***
Java module is searching all JARs with COMPILE capability, when it collects contents of a package during parsing. It keeps ZipEntries for some period of time, so the FileObject from the JAR is alive and the JAR file is, presumably, open. Radek, do you have any idea how to handle this ?
I'm not sure this is a bug. If the JAR is not deletable after *unmounting* the JAR filesystem, that is probably a bug. But if it is not deleted while the JAR is mounted, surely that is as designed (WONTFIX): Windows has mandatory file locks, there is not much to be done.
*** Issue 8434 has been marked as a duplicate of this issue. ***
*** Issue 24473 has been marked as a duplicate of this issue. ***
Set target milestone to TBD
*** Issue 25852 has been marked as a duplicate of this issue. ***
I've exactly the same problem. I was unable to delete WEB- INF node even then jar files was unmounted. How to reproduce: mount a directory with CDShopCart example. Unmount all jar files from the root filesystems. Now try to delete WEB-INF node. Following exception will be thrown: Annotation: Cannot delete file WEB-INF/lib/standard.jar in C:\Test. org.openide.filesystems.FSException: Cannot delete file WEB- INF/lib/standard.jar in C:\Test. at org.openide.filesystems.FSException.io (FSException.java:91) at org.openide.filesystems.LocalFileSystem.delete (LocalFileSystem.java:299) at org.netbeans.core.ExLocalFileSystem.delete (ExLocalFileSystem.java:77) at org.openide.filesystems.LocalFileSystem$Impl.delete (LocalFileSystem.java:651) at org.openide.filesystems.AbstractFileObject.delete (AbstractFileObject.java:490) at org.openide.loaders.FileEntry.delete (FileEntry.java:100) at org.openide.loaders.MultiDataObject.handleDelete (MultiDataObject.java:422) at org.openide.loaders.DataObject$3.run (DataObject.java:536) at org.openide.filesystems.EventControl.runAtomicAction (EventControl.java:89) at org.openide.filesystems.FileSystem.runAtomicAction (FileSystem.java:416) at org.openide.loaders.DataObject.delete (DataObject.java:534) at org.openide.loaders.DataFolder.handleDelete (DataFolder.java:596) at org.openide.loaders.DataObject$3.run (DataObject.java:536) at org.openide.filesystems.EventControl.runAtomicAction (EventControl.java:89) at org.openide.filesystems.FileSystem.runAtomicAction (FileSystem.java:416) at org.openide.loaders.DataObject.delete (DataObject.java:534) at org.openide.loaders.DataFolder.handleDelete (DataFolder.java:596) at org.netbeans.modules.web.context.WebInfObject.handleDelete (WebInfObject.java:150) at org.openide.loaders.DataObject$3.run (DataObject.java:536) at org.openide.filesystems.EventControl.runAtomicAction (EventControl.java:89) at org.openide.filesystems.FileSystem.runAtomicAction (FileSystem.java:416) at org.openide.loaders.DataObject.delete (DataObject.java:534) at org.openide.loaders.DataNode.destroy (DataNode.java:221) at org.openide.nodes.FilterNode.destroy (FilterNode.java:399) at org.openide.nodes.FilterNode.destroy (FilterNode.java:399) at org.openide.explorer.ExplorerActions$DeleteActionPerformer$D estroyAtomic.invoke(ExplorerActions.java:531) at $Proxy4.run(Unknown Source) at org.openide.filesystems.EventControl.runAtomicAction (EventControl.java:89) at org.openide.filesystems.FileSystem.runAtomicAction (FileSystem.java:416) at org.openide.explorer.ExplorerActions$DestroyInvoker.run (ExplorerActions.java:565) at org.openide.explorer.ExplorerActions$DeleteActionPerformer.d oDestroy(ExplorerActions.java:506) at org.openide.explorer.ExplorerActions$DeleteActionPerformer.p erformAction(ExplorerActions.java:476) at org.openide.util.actions.CallbackSystemAction.performAction (CallbackSystemAction.java:108) at org.openide.util.actions.CallableSystemAction.actionPerforme d(CallableSystemAction.java:69) at org.netbeans.core.ModuleActions$1.run (ModuleActions.java:100) at org.openide.util.Task.run(Task.java:136)
Occures for unmounted jar files in win2000 and winXP. This is especially anyoing when you need to mount jars that are build by a process outside of netbeans since you simply cannot rebiuld them once you have touched them in netbeans. Workaround: restarting netbeans or switching projects.
*** Issue 26866 has been marked as a duplicate of this issue. ***
Definitely won't be fixed in 3.5.
See org.netbeans.JarClassLoader for some unpleasant workarounds used by the module system that may be useful. I have filed Java bugs where appropriate, but we cannot rely on them being fixed any time soon.
Fixed in trunk. JarFile is closed as quickly as possible. Streams are firts copied and then returned. /cvs/openide/src/org/openide/filesystems/JarFileSystem.java,v <-- JarFileSystem.java new revision: 1.79; previous revision: 1.78
The solotion seems be fine.
This issue had *1 votes* before move to platform component