oops, too many things going on at once here....

This nasty and remarkably uninformative exception usually occurs because some other exception occurred and was ignored earlier in your app deployment. IIRC I haven't found a way to get tomcat to tell you what the problem is rather than blythely continuing on as if nothing is wrong, and then presenting this misleading exception. IIRC I have always been forced to debug through the tomcat deployment code to find out what is wrong.

It's possible my memory is bad that if you make sure logging is set high enough and scour your geronimo log or command line console tomcat actually does hint at the cause earlier.

thanks
david jencks

On May 23, 2007, at 8:16 AM, Doug Lochart wrote:

I looked into the code where the exception is occuring and it seems to be choking (Null Pointer Exception) on the context. Evidently the context is null. I see there is a setContext() method on the TomcatWebAppContext.java class but do not know where it is called from.

I am focusing on the following part of the stack trace I recieved.

java.lang.NullPointerException
      at java.util.Hashtable.put(Hashtable.java:630)
at org.apache.naming.resources.DirContextURLStreamHandler.bind (DirContextURLStreamHandler.java:233) at org.apache.geronimo.tomcat.TomcatWebAppContext.doStart (TomcatWebAppContext.java:443) at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance (GBeanInstance.java:981) Am I correct in thinking it is a null context OR that part of the context is null? Any idea what would cause this? I do NOT have a geronimo-web.xml in the WAR that is deployed with the ear. This is the web.xml that is in the WAR.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance" id="WebApp_ID" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http:// java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>HTTP router for FrancePolicyServer_EJB.jar</ display-name> <display-name>HTTP router for FrancePolicyServer_EJB.jar</ display-name>
   <servlet>
<display-name>Web services Router servlet for port-component FrancePolicyService</display-name> <display-name>Web services Router servlet for port-component FrancePolicyService</display-name>
       <servlet-name>FrancePolicyService</servlet-name>
<servlet- class>com.ibm.ws.webservices.engine.transport.http.WebServicesServlet< /servlet-class>
   </servlet>
   <servlet-mapping>
       <servlet-name>FrancePolicyService</servlet-name>
       <url-pattern>services/FrancePolicyService</url-pattern>
   </servlet-mapping>
</web-app>

see double instances for display-name and I am wondering could that be the cause of anything. If so it should have choked during deployment and not at runtime. This is what was generated my the tool I have to use. Believe it or not this is one of 3 xml files that make up the entire contents of the WAR. The WebServicesServlet class is in the jar that I installed as a common lib. The other 2 xml docs are WAS 6.0 specific so should be ignored. I may take David's advice and try to deploy again without the WAR but as of now the powers that be want to to try the whole shebang. I have a feeling the servlet routing class will need the WAS files to route the service requests anyway.

Anybody know what might cause the NPE? I will try and deploy without the WAR next

thanks

Doug



Doug Lochart wrote:
Anybody have any idea what might cause this exception? Since the Ear deployed and it is trying to start I would assume it is something with the EAR however I find it odd that a root cause is a Null Pointer Exception. Do any one of you developers know the area of code the NPE is occurring and what might be causing it?

thanks

Doug

Doug Lochart wrote:
I used the webconsole and added it to Common Libs. It ended up creating a directory under the repository named dlochart (not sure where it got that from) and dropped the jar under the name I gave it. I looked and I saw axis so i blindly followed and added this to my plan.

<sys:dependency>
    <sys:groupId>geronimo</sys:groupId>
    <sys:artifactId>sharedlib</sys:artifactId>
    <sys:type>car</sys:type>
 </sys:dependency>

I still received the same exception so I looked again and I saw there was an axis under geronimo which told me that I need to sdjust my dependency so I guessed it would need to be this:

<sys:dependency>
    <sys:groupId>dlochart</sys:groupId>
    <sys:artifactId>ibm-runtime</sys:artifactId>
    <sys:type>jar</sys:type>
 </sys:dependency>

Am I correct on this considering I have a jar under $geronimo_home/repositories/dlochart/ibm-runtime/6.1.0 ?

Either way I recieved the same exception as below. Any idea what the exception might mean?

thanks

org.apache.geronimo.kernel.config.LifecycleException: start of france/FrancePolicyServerEar/1.0/car failed at org.apache.geronimo.kernel.config.SimpleConfigurationManager.start Configuration(SimpleConfigurationManager.java:544) at org.apache.geronimo.kernel.config.SimpleConfigurationManager.start Configuration(SimpleConfigurationManager.java:508) at org.apache.geronimo.kernel.config.SimpleConfigurationManager$ $FastClassByCGLIB$$ce77a924.invoke(<generated>) at net.sf.cglib.reflect.FastMethod.invoke (FastMethod.java:53) at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke (FastMethodInvoker.java:38) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke (GBeanOperation.java:122) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke (GBeanInstance.java:852) at org.apache.geronimo.kernel.basic.BasicKernel.invoke (BasicKernel.java:239) at org.apache.geronimo.kernel.KernelGBean.invoke (KernelGBean.java:338) at org.apache.geronimo.kernel.KernelGBean$ $FastClassByCGLIB$$1cccefc9.invoke(<generated>) at net.sf.cglib.reflect.FastMethod.invoke (FastMethod.java:53) at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke (FastMethodInvoker.java:38) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke (GBeanOperation.java:122) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke (GBeanInstance.java:852) at org.apache.geronimo.kernel.basic.BasicKernel.invoke (BasicKernel.java:239) at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke (MBeanGBeanBridge.java:168) at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke (DynamicMetaDataImpl.java:231) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke (MetaDataImpl.java:238) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:833) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke (JmxMBeanServer.java:802) at javax.management.remote.rmi.RMIConnectionImpl.doOperation (RMIConnectionImpl.java:1423) at javax.management.remote.rmi.RMIConnectionImpl.access $100(RMIConnectionImpl.java:96) at javax.management.remote.rmi.RMIConnectionImpl $PrivilegedOperation.run(RMIConnectionImpl.java:1260) at java.security.AccessController.doPrivileged (AccessController.java:275) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperatio n(RMIConnectionImpl.java:1363) at javax.management.remote.rmi.RMIConnectionImpl.invoke (RMIConnectionImpl.java:797) at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:615)
at sun.rmi.server.UnicastServerRef.dispatch (UnicastServerRef.java:309)
       at sun.rmi.transport.Transport$1.run(Transport.java:168)
at java.security.AccessController.doPrivileged (AccessController.java:275) at sun.rmi.transport.Transport.serviceCall (Transport.java:164) at sun.rmi.transport.tcp.TCPTransport.handleMessages (TCPTransport.java:506) at sun.rmi.transport.tcp.TCPTransport $ConnectionHandler.handleRequest(TCPTransport.java:838) at sun.rmi.transport.tcp.TCPTransport $ConnectionHandler.run(TCPTransport.java:912)
       at java.lang.Thread.run(Thread.java:799)
Caused by: org.apache.geronimo.kernel.config.InvalidConfigException: Unknown start exception at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigura tionGBeans(ConfigurationUtil.java:440) at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigura tionGBeans(ConfigurationUtil.java:411) at org.apache.geronimo.kernel.config.KernelConfigurationManager.start (KernelConfigurationManager.java:187) at org.apache.geronimo.kernel.config.SimpleConfigurationManager.start Configuration(SimpleConfigurationManager.java:527)
       ... 36 more
Caused by: org.apache.geronimo.gbean.InvalidConfigurationException: Configuration france/ FrancePolicyServerEar_FrancePolicyServer_WEB.war/1.0/car failed to start due to the following reasons: The service J2EEApplication=france/FrancePolicyServerEar/1.0/ car,j2eeType=WebModule,name=FrancePolicyServer_WEB.war did not start because the doStart method threw an exception.
java.lang.NullPointerException
       at java.util.Hashtable.put(Hashtable.java:630)
at org.apache.naming.resources.DirContextURLStreamHandler.bind (DirContextURLStreamHandler.java:233) at org.apache.geronimo.tomcat.TomcatWebAppContext.doStart (TomcatWebAppContext.java:443) at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance (GBeanInstance.java:981) at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullSt art(GBeanInstanceState.java:267) at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start (GBeanInstanceState.java:102) at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursiv e(GBeanInstanceState.java:124) at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive (GBeanInstance.java:540) at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean (BasicKernel.java:379) at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigura tionGBeans(ConfigurationUtil.java:374) at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigura tionGBeans(ConfigurationUtil.java:411) at org.apache.geronimo.kernel.config.KernelConfigurationManager.start (KernelConfigurationManager.java:187) at org.apache.geronimo.kernel.config.SimpleConfigurationManager.start Configuration(SimpleConfigurationManager.java:527) at org.apache.geronimo.kernel.config.SimpleConfigurationManager.start Configuration(SimpleConfigurationManager.java:508) at org.apache.geronimo.kernel.config.SimpleConfigurationManager$ $FastClassByCGLIB$$ce77a924.invoke(<generated>) at net.sf.cglib.reflect.FastMethod.invoke (FastMethod.java:53) at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke (FastMethodInvoker.java:38) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke (GBeanOperation.java:122) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke (GBeanInstance.java:852) at org.apache.geronimo.kernel.basic.BasicKernel.invoke (BasicKernel.java:239) at org.apache.geronimo.kernel.KernelGBean.invoke (KernelGBean.java:338) at org.apache.geronimo.kernel.KernelGBean$ $FastClassByCGLIB$$1cccefc9.invoke(<generated>) at net.sf.cglib.reflect.FastMethod.invoke (FastMethod.java:53) at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke (FastMethodInvoker.java:38) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke (GBeanOperation.java:122) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke (GBeanInstance.java:852) at org.apache.geronimo.kernel.basic.BasicKernel.invoke (BasicKernel.java:239) at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke (MBeanGBeanBridge.java:168) at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke (DynamicMetaDataImpl.java:231) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke (MetaDataImpl.java:238) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:833) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke (JmxMBeanServer.java:802) at javax.management.remote.rmi.RMIConnectionImpl.doOperation (RMIConnectionImpl.java:1423) at javax.management.remote.rmi.RMIConnectionImpl.access $100(RMIConnectionImpl.java:96) at javax.management.remote.rmi.RMIConnectionImpl $PrivilegedOperation.run(RMIConnectionImpl.java:1260) at java.security.AccessController.doPrivileged (AccessController.java:275) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperatio n(RMIConnectionImpl.java:1363) at javax.management.remote.rmi.RMIConnectionImpl.invoke (RMIConnectionImpl.java:797) at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:615)
at sun.rmi.server.UnicastServerRef.dispatch (UnicastServerRef.java:309)
       at sun.rmi.transport.Transport$1.run(Transport.java:168)
at java.security.AccessController.doPrivileged (AccessController.java:275) at sun.rmi.transport.Transport.serviceCall (Transport.java:164) at sun.rmi.transport.tcp.TCPTransport.handleMessages (TCPTransport.java:506) at sun.rmi.transport.tcp.TCPTransport $ConnectionHandler.handleRequest(TCPTransport.java:838) at sun.rmi.transport.tcp.TCPTransport $ConnectionHandler.run(TCPTransport.java:912)
       at java.lang.Thread.run(Thread.java:799)


at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigura tionGBeans(ConfigurationUtil.java:403)
       ... 39 more
   Error: Operation failed: start of
   france/FrancePolicyServerEar/1.0/car failed


For completeness I will include the geronimo-application.xml and openejb-jar.xml
geronimo-application.xml
-----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<application application-name="FrancePolicyServerEar"
xmlns="http://geronimo.apache.org/xml/ns/j2ee/ application-1.1" xmlns:sec="http://geronimo.apache.org/xml/ns/ security-1.1" xmlns:sys="http://geronimo.apache.org/xml/ns/ deployment-1.1">
 <sys:environment>
   <sys:moduleId>
     <sys:groupId>france</sys:groupId>
     <sys:artifactId>FrancePolicyServerEar</sys:artifactId>
     <sys:version>1.0</sys:version>
     <sys:type>car</sys:type>
   </sys:moduleId>
   <sys:dependencies>
     <sys:dependency>
     <sys:groupId>geronimo</sys:groupId>
     <sys:artifactId>axis</sys:artifactId>
     <sys:type>car</sys:type>
     </sys:dependency>
   </sys:dependencies>
   <sys:hidden-classes/>
   <sys:non-overridable-classes/>
 </sys:environment>
</application>

openejb-jar.xml
---------------------
<openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb- jar-2.1"> <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/ deployment-1.1">
   <dep:moduleId>
     <dep:groupId>qdfrancepolicy.</dep:groupId>
     <dep:artifactId>FrancePolicyServverEjb</dep:artifactId>
     <dep:version>1.0</dep:version>
     <dep:type>car</dep:type>
   </dep:moduleId>
   <dep:dependencies>
     <dep:dependency>
       <dep:groupId>geronimo</dep:groupId>
       <dep:artifactId>tomcat</dep:artifactId>
       <dep:type>car</dep:type>
     </dep:dependency>
   </dep:dependencies>
   <dep:hidden-classes/>
   <dep:non-overridable-classes/>
 </dep:environment>
 <enterprise-beans>
   <session>
     <ejb-name>FrancePolicyServer</ejb-name>
     <jndi-name>qdfrancepolicy.FrancePolicyHome</jndi-name>
   </session>
 </enterprise-beans>
</openejb-jar>


This ear includes a WAR which is merely a WebServiceRouter (ibm class), EJB WebService Session Bean implementation, and some JARs that the code depends upon.

Note:

The WAR router servlet is an IBM specific class that lives in a jar that is not in the ear as it is expected to be in the WAS system and I assume available to all. I added this jar to the lib directory under the geronimo install. I hope this is sufficient for this if not I would like to know the best strategy for deploying this jar preferrably outside the EAR.

thanks

Doug













Reply via email to