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 247947 - Netbeans fails to build java projects 2 out of 3 times with simple project dependencies
Summary: Netbeans fails to build java projects 2 out of 3 times with simple project de...
Status: RESOLVED INCOMPLETE
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P1 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-15 11:12 UTC by netbeansuzr
Modified: 2015-02-20 12:39 UTC (History)
2 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 netbeansuzr 2014-10-15 11:12:14 UTC
NetBeans is pretty much unusable.  I have been dealing with this issue for a while now and I'm tired of it.  I have project A which depends on a library project B (both standard java projects without any build customizations).  2/3 or 1/2 times I try to build project A or run a main class from project A, NetBeans fails to compile the projects.  I have tried variations of compile on save on and off.  It usually happens after an IDE startup or after working in the IDE for a while.

I think this IDE is great for the most part, but something so basic as compiling two simple projects fails all the time, it really makes the IDE annoying and unusable.

When the compilation doesn't fail, I often get an error from NetBeans saying that it can't delete a .gif file from it's own project's build directory that it manages (I have some gif files inside one of the packages).  When this error happens, then no matter how many times I try to clean and build, NetBeans will fail with the same error.  The only way to fix this is to restart the IDE.

I think the background scanning is interfering with build process.
Comment 1 Jiri Prox 2014-10-17 07:25:09 UTC
Please attach the messages.log and the output of build action

Thanks
Comment 2 netbeansuzr 2014-10-19 12:41:50 UTC
There is the following error in the logs when it can't delete the .gif file:

INFO [org.openide.filesystems.JarFileSystem]: error in opening zip file
java.util.zip.ZipException: error in opening zip file
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:220)
	at java.util.zip.ZipFile.<init>(ZipFile.java:150)
	at java.util.jar.JarFile.<init>(JarFile.java:166)
	at java.util.jar.JarFile.<init>(JarFile.java:145)
[catch] at org.openide.filesystems.JarFileSystem.getJar(JarFileSystem.java:965)
	at org.openide.filesystems.JarFileSystem.reOpenJarFile(JarFileSystem.java:736)
	at org.openide.filesystems.JarFileSystem.parse(JarFileSystem.java:839)
	at org.openide.filesystems.JarFileSystem.access$100(JarFileSystem.java:93)
	at org.openide.filesystems.JarFileSystem$1.fileChanged(JarFileSystem.java:357)
	at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:461)
	at com.sun.proxy.$Proxy1.fileChanged(Unknown Source)
	at org.openide.filesystems.FCLSupport$DispatchEventWrapper.dispatchEventImpl(FCLSupport.java:178)
	at org.openide.filesystems.FCLSupport$DispatchEventWrapperSingle.dispatchAllEventsSync(FCLSupport.java:224)
	at org.openide.filesystems.FCLSupport$DispatchEventWrapper.dispatchEvent(FCLSupport.java:137)
	at org.openide.filesystems.FCLSupport.dispatchEvent(FCLSupport.java:105)
	at org.openide.filesystems.FileObject$ED.dispatch(FileObject.java:1318)
	at org.openide.filesystems.FileSystem$EventDispatcher.run(FileSystem.java:999)
	at org.openide.filesystems.EventControl.dispatchEvent(EventControl.java:84)
	at org.openide.filesystems.FileSystem.dispatchEvent(FileSystem.java:644)
	at org.openide.filesystems.FileObject.dispatchEvent(FileObject.java:635)
	at org.openide.filesystems.FileObject.fireFileChangedEvent(FileObject.java:603)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.BaseFileObj.fireFileChangedEvent(BaseFileObj.java:697)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.refreshImpl(FileObj.java:364)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.BaseFileObj.refresh(BaseFileObj.java:843)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.refresh(FileObj.java:375)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.refreshImpl(FolderObj.java:484)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.BaseFileObj.refresh(BaseFileObj.java:843)
	at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.refresh(FolderObj.java:562)
	at org.openide.filesystems.FileObject.refresh(FileObject.java:1206)
	at org.netbeans.modules.masterfs.watcher.Watcher$1.run(Watcher.java:422)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)

then it points to the jar file that contains the gif
Comment 3 netbeansuzr 2014-10-19 12:46:45 UTC
It looks like I can reproduce the unable to delete error if I hit play on the project right after netbeans starts up (while it's still background scanning).  If I do this, even after the background scan finishes, it still can't delete the file and I have to restart the IDE.

Can you please check your background scanning code and make sure it doesn't interfere with the build process?  I noticed that while I'm building a project, the background scan will sometimes kicks in.  Why is it background scanning compiled code that is completely managed by the IDE?

Thanks
Comment 4 Tomas Zezula 2014-10-21 08:40:44 UTC
The scan process do not touch either the "build" or the "dist" folder.
It uses just the project's source folders.
The editor was opening the dist/**.jar files while loading annotation processors.
However it was fixed in NB 8.0.1 the processor loading is exclusive to the clean action.
Comment 5 Tomas Zezula 2014-10-21 13:26:34 UTC
To QA: The problem needs to be reproduced on Windows. UNIX has much more robust file system implementation and is not susceptible to these problems.
Comment 6 Tomas Zezula 2014-10-23 07:46:30 UTC
In reply to comment #2:
>There is the following error in the logs when it can't delete the .gif file
Which gif?
The only part of the build which deletes something is a clean and it deletes the jar files as whole it does not delete individual files from the archive.
Can you describe it in more details?
Thanks
Comment 7 netbeansuzr 2014-12-04 16:48:16 UTC
This is still not fixed in:
Product Version: NetBeans IDE 8.0.2 (Build 201411181905)

The unit test window with the progress is also broken.  It randomly doesn't display the tests below the progress bar when running the same test class (even without changing the test class).
Comment 8 netbeansuzr 2014-12-24 17:27:05 UTC
This issue is still unresolved.  Is there any update on it?

Just having a .gif file in project A, and then doing a clean and build on project B (which under libraries depends on project A), results in this failure.

More detailed explanation/environment:

Project A
-has a .gif in the classpath.  This gif is referenced from a BeanInfoObject which is for a custom GUI component (similar to a check box in this example).  This custom GUI component along with the Bean Info and the .gif are all in project A

Project B
-depends on project A through libraries

Project C
-depends on project A through libraries
-depends on project B through libraries

Scenario to reproduce
-start the NetBeans IDE (with all the above projects already open from the previous run), then right click on Project C and click on clean and build.  Often times the build will fail complaining that it can't delete the .gif file.  Doing clean and build again still causes the same failure message and the only way to fix this is to restart the IDE and hope that it doesn't happen again.  If instead of cleaning and building project C, I manually build project A first, then project B, then project C, the failure either doesn't happen at all or is less likely to happen.  The problem is that after developing for a while, I can run into the same issue.  I should not have to build projects A and B manually, that's why I use an IDE to automate tasks like this.

Note that all projects, A, B and C have "Build Projects on Classpath" under libraries checked.

Since you were unable to reproduce the issue, I'm thinking it might be related to the Graphical GUI editor in NetBeans or possibly also to the above project dependency setup.

Can you please try to reproduce this issue and fix it.  It is extremely annoying and time consuming to deal with every day.
Comment 9 Jiri Prox 2015-01-08 11:46:30 UTC
I've tried to setup the project according to your description but I didn't get the error.

I even tried to use the UI beans from project A in the form in project C.

Sometimes when I run clean & build too fast in a row the error orrures saying Cannot delete A.jar (which is product of project A). But after a shor while (about 4s on my computer) all is fine againg and next clean&build is correct.

Can you please provide more info?

1) What proecess is holding the gif? (you can find it by proces explorer)


2) Can you set ant verbosity level to debug (in Options -> Java -> Ant) and post the clean & build output?

3) can you share the projects? Or at least the importatnt part (you can send it by mail directly to me, if you don't want to share it here)

Thanks
Comment 10 Antonin Nebuzelsky 2015-02-20 12:39:11 UTC
Reporter, please provide the information requested above. Then reopen. Thanks.