I am developing a Java EE enterprise application using NetBeans IDE. I can develop and test my whole application on the Glassfish instance bundled with NetBeans IDE, but I face kind of vague errors when I try to deploy my application on our production Glassfish server. Every time I try to deploy the .ear package on the server, Glassfish reports this error:
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.
The application is developed from scratch on NetBeans 7.2, Java EE 6, JDK 7 and deployed on GlassFish 3.1.2.2. Changing the log levels to ALL does not make GlassFish produce more helpful error message. There are other solutions mentioned on the web, including creating an empty, 0-byte beans.xml file and using another application server such as JBoss. I didn't try JBoss or other app servers, but cannot find what causes the error on Glassfish.