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.
Hello, Here is a problem happening when I launch NetBeans 4.1 on a Windows98 platform: java.io.IOException: Could not delete: C:\WINDOWS\.netbeans\4.1\var\cache\all-layers.dat You will see all detail down here... It's not important for me, I just want to help. Thanks for having permitted me to download this IDE for free ! It helps me keep an eye on java evolution. ero. --------------- ------------------------------------------------------------------------------- >Log Session: Friday, August 12, 2005 4:22:58 PM CEST >System Info: Product Version = NetBeans IDE 4.1 (Build 200505031930) Operating System = Windows 98 version 4.10 running on x86 Java; VM; Vendor = 1.5.0_04; Java HotSpot(TM) Client VM 1.5.0_04-b05; Sun Microsystems Inc. Java Home = D:\PROGRAM FILES\JAVA\JDK1.5.0_04\JRE System Locale; Encod. = fr_FR (nb); Cp1252 Home Dir; Current Dir = C:\WINDOWS; D:\program files\netbeans-4.1 IDE Install; User Dir = D:\PROGRAM FILES\NETBEANS-4.1\PLATFORM5; C:\WINDOWS\.netbeans\4.1 CLASSPATH = D:\PROGRAM FILES\NETBEANS-4.1\PLATFORM5\lib\boot.jar;D:\program files\Java\jdk1.5.0_04\lib\dt.jar;D:\program files\Java\jdk1.5.0_04\lib\tools.jar Boot & ext classpath = D:\PROGRAM FILES\JAVA\JDK1.5.0_04\JRE\lib\rt.jar;D:\PROGRAM FILES\JAVA\JDK1.5.0_04\JRE\lib\i18n.jar;D:\PROGRAM FILES\JAVA\JDK1.5.0_04\JRE\lib\sunrsasign.jar;D:\PROGRAM FILES\JAVA\JDK1.5.0_04\JRE\lib\jsse.jar;D:\PROGRAM FILES\JAVA\JDK1.5.0_04\JRE\lib\jce.jar;D:\PROGRAM FILES\JAVA\JDK1.5.0_04\JRE\lib\charsets.jar;D:\PROGRAM FILES\JAVA\JDK1.5.0_04\JRE\classes;D:\PROGRAM FILES\JAVA\JDK1.5.0_04\JRE\lib\ext\dnsns.jar;D:\PROGRAM FILES\JAVA\JDK1.5.0_04\JRE\lib\ext\sunjce_provider.jar;D:\PROGRAM FILES\JAVA\JDK1.5.0_04\JRE\lib\ext\sunpkcs11.jar;D:\PROGRAM FILES\JAVA\JDK1.5.0_04\JRE\lib\ext\localedata.jar Dynamic classpath = D:\program files\netbeans-4.1\platform5\core\core.jar;D:\program files\netbeans-4.1\platform5\core\openide-loaders.jar;D:\program files\netbeans-4.1\platform5\core\openide.jar;D:\program files\netbeans-4.1\platform5\core\org-netbeans-swing-plaf.jar;D:\program files\netbeans-4.1\platform5\core\updater.jar;D:\program files\netbeans-4.1\nb4.1\core\org-netbeans-upgrader.jar;D:\program files\netbeans-4.1\nb4.1\core\locale\core_nb.jar;D:\program files\netbeans-4.1\ide5\core\org-netbeans-modules-utilities-cli.jar ------------------------------------------------------------------------------- [org.netbeans.core.modules #4] Upgrading 'jar' param from org-netbeans-modules-profiler-j2ee.jar to modules/eager/org-netbeans-modules-profiler-j2ee.jar and removing 'origin' installation/eager [org.netbeans.core.modules #4] Warning - had to upgrade dependencies for module org.netbeans.modules.profiler.j2ee: added = [module org.netbeans.modules.projectapi/1 > 1.3, module org.netbeans.modules.java.platform/1 > 1.3, module org.netbeans.modules.project.ant/1 > 1.3] removed = [module org.netbeans.modules.java.platform/0, module org.netbeans.modules.project.ant/0 > 1.0, module org.netbeans.modules.projectapi/0 > 1.0]; details: [Major release version of module changed from 0 to 1 to signal stability; update your dependencies] [org.netbeans.core.projects] INFORMATIONAL *********** Exception occurred ************ at 4:23 PM on Aug 12, 2005 java.io.IOException: Could not delete: C:\WINDOWS\.netbeans\4.1\var\cache\all-layers.dat at org.netbeans.core.projects.cache.BinaryCacheManager.cleanupCache(BinaryCacheManager.java:56) at org.netbeans.core.projects.cache.BinaryCacheManager.store(BinaryCacheManager.java:88) at org.netbeans.core.projects.cache.ParsingLayerCacheManager.store(ParsingLayerCacheManager.java:87) [catch] at org.netbeans.core.projects.ModuleLayeredFileSystem$1.run(ModuleLayeredFileSystem.java:254) at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:89) at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:432) at org.netbeans.core.projects.ModuleLayeredFileSystem.setURLs(ModuleLayeredFileSystem.java:242) at org.netbeans.core.projects.ModuleLayeredFileSystem.addURLs(ModuleLayeredFileSystem.java:315) at org.netbeans.core.modules.NbInstaller.loadLayers(NbInstaller.java:559) at org.netbeans.core.modules.NbInstaller.load(NbInstaller.java:205) at org.netbeans.core.modules.ModuleManager.enable(ModuleManager.java:869) at org.netbeans.core.modules.ModuleList.installNew(ModuleList.java:382) at org.netbeans.core.modules.ModuleList.trigger(ModuleList.java:316) at org.netbeans.core.modules.ModuleSystem.restore(ModuleSystem.java:253) at org.netbeans.core.NonGui.run(NonGui.java:355) at org.netbeans.core.Main.run(Main.java:185) at org.netbeans.core.NbTopManager.getNbTopManager(NbTopManager.java:241) at org.netbeans.core.NbTopManager.get(NbTopManager.java:190) at org.netbeans.core.Main.start(Main.java:311) at org.netbeans.core.TopThreadGroup.run(TopThreadGroup.java:90) at java.lang.Thread.run(Thread.java:595)
I suppose it's not important since the exception is marked as INFORMATIONAL, reassigning just to be sure.
No idea how to go about reproducing this. java.io.File.delete() just returns false if deletion fails; there is no way to get details from the operating system as to what is wrong. Perhaps the directory - or drive - was read-only at the time; perhaps some other process had that file open; etc. Unless this is known to happen to other people (only Win98?) I will have to close, I guess.
Thank you for your opinion. As I said in the query, it's not a problem for me, I can live with it, and I don't mind if you close this query. I agree that it could be only a win98 problem. Here is my comment: - it is not a question of read-only in file properties (I checked this and also the parent folders) - it happens systematically, each time I launch NetBeans, as sure as a mathematical operation I'll keep an eye on this query to see if you have any more questions. Best respects. ero.
The process that opened the file was the IDE itself. It actually mapped the file. The problem is that the file was mmaped, then recognized as out of date and about to be recreated. java.nio has no way of explicit unmapping, and Windows can't delete the file while mapped (ugh, every sane OS manages that correctly, yet windows is much more prone to lost clusters...). In my experience, it was at least possible to rename the file, but it seems Win98 fails even on that. As a workaround, you can delete the file yourself, it will get recreated during next startup and should stay that way (no more recreations during subsequent startups) as long as you don't change the module set. If we wanted to fix this, we'd have to special-case Win98 and create a HeapByteBuffer instead.
I guess you're talking about the BinaryFS constructor. So there's no way to close a mmap'd file except by GCing the MappedByteBuffer? That's awful!
Work-around seems to work well... Thank very much you for your response, I don't need more. At least we know now the cause of the problem! ero.
*** Issue 64064 has been marked as a duplicate of this issue. ***
*** Issue 65091 has been marked as a duplicate of this issue. ***
*** Issue 64139 has been marked as a duplicate of this issue. ***
I'm wondering what a work-around might be for this? I've seen the same behavior on WinXP when the IDE starts up and attempts to open files in my users' roaming profiles.
Petr do you have some idea how to deal with this? I don't even know how to reproduce it. It seems that you already put in the code which uses mmaped buffers and which therefore renames, rather than deletes, the file, to work around the Windows bug. (Is that filed for the JDK? Should use jdk_bug_NNNNNNN in status whiteboard.) If this is really a GC problem, the only thing I can think to do is insert if (!renamed) { System.gc(); renamed = cacheFile.renameTo(tmpFile); // try again } but I have no way of testing whether such a fix really works. I suspect it would not be reliable. If it really worled, it would make startup a bit slower for affected machines, but no exception at least. If that doesn't work, we could consider creating alternate all-layers1.dat and all-layers2.dat and permitting either to be used. (But what if both exist...?) Or, if cleanupCache() when called from store() fails, just print the IOE message to console as a warning, then pick a new cacheFile - meaning, I guess, that the caching would not actually work, and startup would be longer. Or, as you suggest, create an in-memory byte buffer. Problem is that you would have to create it only conditionally, to avoid damaging performance on other platforms, and I am not sure if just checking for "98" in the OS name is reliable enough. Last comment suggests that other Windows machines can be affected sometimes.
Jarda, try to look at this one. I thought the trick with renaming the file was already in.
The renaming code is there from the beginning. The problem is that win98 won't let you even rename an opened file. The only occurence on non-w98 (issue 64064) seems to be more of a configuration issue (special networked setup) that this actual problem. If we could recognize w98, I'd go for HeapByteBuffer on that platform.
"#62247: Hoping to fix the problem for Windows98. #1 - we try a bit harder to GC the mmaped handle, #2 - if the rename files we still mark the file as delete on exit, so even if the exception is printed, next start should be ok" Checking in startup/src/org/netbeans/core/startup/layers/BinaryCacheManager.java; /cvs/core/startup/src/org/netbeans/core/startup/layers/BinaryCacheManager.java,v <-- BinaryCacheManager.java new revision: 1.2; previous revision: 1.1
*** Issue 67798 has been marked as a duplicate of this issue. ***
*** Issue 71624 has been marked as a duplicate of this issue. ***
*** Issue 71873 has been marked as a duplicate of this issue. ***
*** Issue 72930 has been marked as a duplicate of this issue. ***