Sunday, April 3, 2011

Error 500--Internal Server Error


I have a struts Application which was deployed in BEA Weblogic Server instance and was working as expected. This Application is using some of the external API’s as well.

As part of enhancement, I modified some of the java files and replaced the external API’s with the re-written API’s and built the application (WAR/JAR) using ecplise-Ant and deployed it on the BEA Weblogic Server instance. Unfortunately it had thrown the “Error 500--Internal Server Error” as below.

==================================================================
Error 500--Internal Server Error
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:163)
at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:138)
at org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:278)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:218)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:446)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7047)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
Caused by: java.lang.NullPointerException
at java.util.Hashtable.get(Hashtable.java:333)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:233)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at com.abc.wam.base.BaseAction.(BaseAction.java:30)
... 24 more



I was 100% sure; this was not the application issue and something to do with the Java classpath. The issue is i didn’t install JAVA JDK on the desktop where I built the application instead I placed the installed version of java jdk & jre folders from other desktop since i didn't have the admin privileges to install the software. And I had set the classpath & javahome variables. This setup was working for all the other applications but not for this application. It was a strange issue and tried the following and resolved this.

If your are getting the above exception try the following possibilities, one of them could solve your issues.


  • Check your application's build path - verify lib jar file locations.
  • Try to build the same application on the other system.
  • Verify the java version and its compatibility with your application.

No comments: