Problem with embedded Glassfish, NetBeans 7.x and Maven
recently I found a little problem that can be very annoying.
I have an JEE application that is deployed and run on embedded Glassfish 3.1.2. When I run the application form NB, two empty files are created in target/classes:
They come form NB compile-on-save
These files are packed into JAR/WAR by ScatteredArchive and then to an EAR by ScatteredEnterpriseArchive. Everything was OK., till I created a portable CDI extension and attached it to an EAR. I got the following exception:
SEVERE: Exception while loading the app : WELD-001417 Enabled interceptor class
org.jboss.weld.exceptions.DeploymentException: WELD-001417 Enabled interceptor class
This exception is completely misleading here. It occurred, that JAR with portable extension containing these two files is corrupt (7zip says it). The problem is only with portable extensions. EJB jars are also corrupted zip archives, but they work.
The solution is to completely disable compile-on-save functionality in NB.