Image via WikipediaSometimes, and maybe always, Glassfish holds open a deployed jar file. When you do a clean build on a Netbeans "Enterprise Application" project, the build will fail saying that the jar file can not be deleted. The jar in question will have a path something like this:
Shutting down Glassfish (completely, you may have to use O/S tools to do this) will allow the jar to be deleted and rebuilt.
This is a big problem because it seems that if you do an ordinary build, rather than a clean build, on the EA project the jar file may not be updated. In one case this lead me to get a very strange runtime error claiming that a general Java class used in the EJB project belonging to the given EA assembly, had no constructor of a given form when clearly it did.
com.iwsinc.cms.jobs.PSStatusCheckJob.<init>(I)VWhat was happening was that the build process was quietly failing to update the EJB part of the EA project - the jar in other words, because it was held open and could be be deleted.
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
This problem, I would guess, only happens on Windows.
Product Version: NetBeans IDE 6.1 (Build 200805300101)
Java: 1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)