Skip to main content

Problem with embedded Glassfish, NetBeans 7.x and Maven

No replies
mkwapisz
Offline
Joined: 2007-01-31
Points: 0

Hi,
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:
.netbeans_automatic_build
.netbeans_update_resources
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 pl.tewi.interceptors.EjbSupportInterceptor in file:/F:/JavaProg/JavaEEIntegration/JavaSeRunnerSample/target/classes/META-INF/beans.xml@6 is neither annotated @Interceptor nor registered through a portable extension
org.jboss.weld.exceptions.DeploymentException: WELD-001417 Enabled interceptor class pl.tewi.interceptors.EjbSupportInterceptor in file:/F:/JavaProg/JavaEEIntegration/JavaSeRunnerSample/target/classes/META-INF/beans.xml@6 is neither annotated @Interceptor nor registered through a portable extension

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.

Regards
Marcin