tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J T Hsiao" <ejths...@gmail.com>
Subject Fwd: NPE running Embedded Tomcat 5.5.17
Date Tue, 09 May 2006 21:53:23 GMT
---------- Forwarded message ----------
From: J T Hsiao <ejthsiao@gmail.com>
Date: May 9, 2006 2:46 PM
Subject: NPE running Embedded Tomcat 5.5.17
To: dev@tomcat.apache.org

Hi,

I ran into a NPE when I tried to run Embedded Tomcat 5.5.17 with
the ant build.  I looked into RealmBase.java at 1329 and found the following
code; the NPE happens because the container is null.

This problem seems to be an Embedded Tomcat specific problem (or the ant
script) as I do not see this problem with regular Tomcat.
Should container be created before we hit this point?  Any one has ideas
before I investigate further?

Thanks,
Eric

-------------------------------

  public void init() {
       this.containerLog = container.getLogger();
      if( initialized && container != null ) return;

      initialized=true;
      if( container== null ) {
          ObjectName parent=null;
            // Register with the parent
          try {
                if( host == null ) {
                  // global
                  parent=new ObjectName(domain +":type=Engine");
              } else if( path==null ) {
                  parent=new ObjectName(domain +
                          ":type=Host,host=3D3D" + host);
              } else {
                  parent=3D3Dnew ObjectName(domain
+":j2eeType=3D3DWebModule,name=3D3D//" +
                            host + path);
              }
              if( mserver.isRegistered(parent ))  {
                  if(log.isDebugEnabled())
                      log.debug("Register with " + parent);
                  mserver.setAttribute(parent, new Attribute("realm",
this));
              }
          } catch (Exception e) {
              log.error ("Parent not available yet: " + parent);
          }


---------------------------------------------------------------------------=
=3D
---------------------------------------------------------------------------=
=3D
---------------------------------------------------------------------------=
=3D
---

uildfile: build.xml

init:

jmx-console-ri:

jmx-console-mx4j:

jmx-console:

run:
[jmx-service] May 9, 2006 11:29:32 AM
org.apache.commons.modeler.ant.MLETTask execute
[jmx-service] INFO: Setting attribute Catalina:type=3D3DServer port
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.commons.modeler.ant.MLETTask execute
[jmx-service] INFO: Setting attribute Catalina:type=3D3DService name
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.commons.modeler.ant.MLETTask execute
[jmx-service] INFO: Setting attribute Catalina:type=3D3DEngine name
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.commons.modeler.ant.MLETTask execute
[jmx-service] INFO: Setting attribute Catalina:type=3D3DEngine baseDir
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.commons.modeler.ant.MLETTask execute
[jmx-service] INFO: Setting attribute Catalina:type=3D3DEngine defaultHost
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.commons.modeler.ant.MLETTask execute
[jmx-service] INFO: Setting attribute Catalina:type=3D3DRealm pathname
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.commons.modeler.ant.MLETTask execute
[jmx-service] INFO: Setting attribute Catalina:type=3D3DConnector,port=3D3D=
9080=3D
 port
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.commons.modeler.ant.MLETTask execute
[jmx-service] INFO: Setting attribute Catalina:type=3D3DHost,host=3D3Dlocal=
host=3D
 name
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.commons.modeler.ant.MLETTask execute
[jmx-service] INFO: Setting attribute Catalina:type=3D3DHost,host=3D3Dlocal=
host
appBase
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.commons.modeler.BaseModelMBean invoke
[jmx-service] SEVERE: Exception invoking method init
[jmx-service] java.lang.NullPointerException
[jmx-service]     at org.apache.catalina.realm.RealmBase.init(RealmBase.jav=
=3D
- Show quoted text -
a
- Show quoted text -
:1329)
[jmx-service]     at jrockit.reflect.VirtualNativeMethodInvoker.invoke (
Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
[jmx-service]     at java.lang.reflect.Method.invoke(Ljava.lang.Object;[
Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
[jmx-service]     at org.apache.commons.modeler.BaseModelMBean.invoke(
BaseModelMBean.java:503)
[jmx-service]     at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(
DynamicMetaDataImpl.java:213)
[jmx-service]     at com.sun.jmx.mbeanserver.MetaDataImpl.invoke (
MetaDataImpl.java:220)
[jmx-service]     at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(
DefaultMBeanServerInterceptor.java:815)
[jmx-service]     at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke (
JmxMBeanServer.java:784)
[jmx-service]     at org.apache.commons.modeler.Registry.invoke(
Registry.java:397)
[jmx-service]     at org.apache.commons.modeler.ant.ServiceTask.execute(
ServiceTask.java:123)
[jmx-service]     at org.apache.tools.ant.UnknownElement.execute(
UnknownElement.java:275)
[jmx-service]     at org.apache.tools.ant.Task.perform(Task.java:364)
[jmx-service]     at org.apache.tools.ant.Target.execute (Target.java:341)
[jmx-service]     at org.apache.tools.ant.Target.performTasks(Target.java
:369)
[jmx-service]     at org.apache.tools.ant.Project.executeTarget(Project.jav=
=3D
a
:1214)
[jmx-service]     at org.apache.tools.ant.Project.executeTargets(
Project.java:1062)
[jmx-service]     at org.apache.tools.ant.Main.runBuild(Main.java:673)
[jmx-service]     at org.apache.tools.ant.Main.startAnt(Main.java:188)
[jmx-service]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java
:196)
[jmx-service]     at org.apache.tools.ant.launch.Launcher.main (
Launcher.jav=
=3D
a
:55)
[jmx-service] May 9, 2006 11:29:33 AM org.apache.commons.modeler.Registryin=
=3D
voke
[jmx-service] INFO: Error initializing Catalina:type=3D3DRealm
javax.management.RuntimeOperationsException: Exception invoking method init
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.coyote.http11.Http11BaseProtocol init
[jmx-service] INFO: Initializing Coyote HTTP/1.1 on http-9080
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.catalina.connector.Connector initialize
[jmx-service] INFO: The connector has already been initialized
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.catalina.core.StandardService start
[jmx-service] INFO: Starting service Tomcat-Standalone
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.coyote.http11.Http11BaseProtocol start
[jmx-service] INFO: Starting Coyote HTTP/1.1 on http-9080
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.commons.modeler.BaseModelMBean invoke
[jmx-service] SEVERE: Exception invoking method init
[jmx-service] java.lang.NullPointerException
[jmx-service]     at org.apache.catalina.realm.RealmBase.init (
RealmBase.jav=
=3D
- Show quoted text -
a
- Show quoted text -
:1329)
[jmx-service]     at jrockit.reflect.VirtualNativeMethodInvoker.invoke (
Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
[jmx-service]     at java.lang.reflect.Method.invoke(Ljava.lang.Object;[
Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
[jmx-service]     at org.apache.commons.modeler.BaseModelMBean.invoke(
BaseModelMBean.java:503)
[jmx-service]     at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(
DynamicMetaDataImpl.java:213)
[jmx-service]     at com.sun.jmx.mbeanserver.MetaDataImpl.invoke (
MetaDataImpl.java:220)
[jmx-service]     at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(
DefaultMBeanServerInterceptor.java:815)
[jmx-service]     at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke (
JmxMBeanServer.java:784)
[jmx-service]     at org.apache.catalina.core.StandardEngine.start(
StandardEngine.java:418)
[jmx-service]     at jrockit.reflect.VirtualNativeMethodInvoker.invoke(
Ljava.lang.Object ;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
[jmx-service]     at java.lang.reflect.Method.invoke(Ljava.lang.Object;[
Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
[jmx-service]     at org.apache.commons.modeler.BaseModelMBean.invoke (
BaseModelMBean.java:503)
[jmx-service]     at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(
DynamicMetaDataImpl.java:213)
[jmx-service]     at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(
MetaDataImpl.java :220)
[jmx-service]     at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(
DefaultMBeanServerInterceptor.java:815)
[jmx-service]     at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(
JmxMBeanServer.java :784)
[jmx-service]     at org.apache.commons.modeler.Registry.invoke(
Registry.java:397)
[jmx-service]     at org.apache.commons.modeler.ant.ServiceTask.execute(
ServiceTask.java:124)
[jmx-service]     at org.apache.tools.ant.UnknownElement.execute(
UnknownElement.java:275)
[jmx-service]     at org.apache.tools.ant.Task.perform(Task.java:364)
[jmx-service]     at org.apache.tools.ant.Target.execute(Target.java:341)
[jmx-service]     at org.apache.tools.ant.Target.performTasks(Target.java
:369)
[jmx-service]     at org.apache.tools.ant.Project.executeTarget(Project.jav=
=3D
a
:1214)
[jmx-service]     at org.apache.tools.ant.Project.executeTargets(
Project.java:1062)
[jmx-service]     at org.apache.tools.ant.Main.runBuild(Main.java:673)
[jmx-service]     at org.apache.tools.ant.Main.startAnt(Main.java:188)
[jmx-service] May 9, 2006 11:29:33 AM
org.apache.catalina.core.StandardEngine start
[jmx-service] INFO: Starting Servlet Engine: Apache Tomcat/5.5.17
[jmx-service] May 9, 2006 11:29:33 AM org.apache.catalina.core.StandardHost=
=3D
start
[jmx-service] INFO: XML validation disabled
[jmx-service] May 9, 2006 11:29:34 AM
org.apache.catalina.realm.JAASRealmsetContainer
[jmx-service] INFO: Set JAAS app name Catalina
[jmx-service] May 9, 2006 11:29:34 AM org.apache.catalina.realm.RealmBasest=
=3D
art
[jmx-service] INFO: This Realm has already been started
[jmx-service] May 9, 2006 11:29:34 AM
org.apache.catalina.connector.Connector start
[jmx-service] INFO: The connector has already been started

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message