Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Exception while loading the app" without a stack trace

I'm migrating my app from GlassFish 3.0.1 to GlassFish 3.1.1. Deployment fails, with the following error messages:

SEVERE: Exception while loading the app
SEVERE: Exception while shutting down application container
SEVERE: Exception while shutting down application container : java.lang.NullPointerException
SEVERE: java.lang.RuntimeException: Error occurred during deployment: Exception while shutting down application container : java.lang.NullPointerException. Please see server.log for more details. 

There is no stack trace. I turned on the root logging level to FINEST, and the first SEVERE message occurs after a Weld message:

//...
FINE: WELD-000105 Enabled interceptor types for Manager
Enabled alternatives: [] []
Registered contexts: [interface javax.enterprise.context.SessionScoped, interface javax.enterprise.context.RequestScoped, interface javax.inject.Singleton, interface javax.enterprise.context.Dependent, interface javax.enterprise.context.ApplicationScoped, interface javax.enterprise.context.ConversationScoped]
Registered beans: 0
Specialized beans: 0
: []

And before several messages like these (for several different classes):

FINE: PWC4451: File cannot be read /opt/sun/glassfish-3.1.1/glassfish/domains/domain1/applications/QmsWeb/WEB-INF/classes/org/jboss/seam/transaction/SeamTransaction.class
FINE: PWC4451: File cannot be read /opt/sun/glassfish-3.1.1/glassfish/domains/domain1/applications/QmsWeb/WEB-INF/classes/org/jboss/seam/transaction/SeamTransaction.class
FINE: PWC4451: File cannot be read /opt/sun/glassfish-3.1.1/glassfish/domains/domain1/applications/QmsWeb/WEB-INF/classes/net/sf/ehcache/config/TerracottaConfiguration$ValueMode.class
//...

What could be causing this error? Could these PWC4451 messages be indicating that some libraries aren't being loaded?

like image 701
Nick Avatar asked Aug 25 '11 18:08

Nick


Video Answer


2 Answers

This was due to a @ViewScoped bean that did not implement Serializable. Apparently, an older version of Weld that we were using didn't find it objectionable that a passivating-scoped bean wasn't Serializable, but this one failed silently because of it. Oh well, hope this saves someone some time.

like image 159
Nick Avatar answered Sep 28 '22 10:09

Nick


After three hours of debugging I fixed a problem like this trying to deploy the application in JBoss 6.

It seems like several error messages from Weld don't get logged properly under Glassfish. In my case I annotated an EJB with @Stateless @RequestScoped (that is illegal, must be @Statefull). With Glassfish I could only see that "error while loading the app", while in JBoss 6 I get the correct error message indicating the offending code.

I suggest that you try deploying on JBoss 6 stripping out all the parts (@Resource with specific JNDI path, for instance) that prevent the Weld deployer to scan the application and validate the CDI stuff.

like image 43
Stefano Travelli Avatar answered Sep 28 '22 09:09

Stefano Travelli