Search code examples
javadeploymentjava-ee-6glassfish-3netbeans-7

Glassfish deployment errors with uninformative error messages


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.


Solution

  • Strangely, the 32-bit JDK running on 64-bit Debian 6 system was causing the error. I have tried every possible relevant and non-relevant thing I could think of, including using the same JDK update, changing /etc/hosts to match the development system, installing NetBeans with bundled Glassfish on the production server (!), using an invalid IP address instead of a valid one, using Oracle Glassfish server instead of the community version, etc. None of them helped. The problem got fixed only after I noticed the 32-bit JDK and replaced it with a 64-bit version.

    The error, its vague reporting and somehow non-relevant cause wasted 5 days of my time. I decided to share my experience, hopefully it helps someone in a similar frustrating situation.