You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Remy Maucherat <re...@apache.org> on 2002/01/21 22:28:05 UTC

[4.1] Custom components causing NPEs when creating MBeans

Hi,

The current code in MBeanUtils doesn't allow to have custom components, and
causes a NPE, such as:
ServerLifecycleListener: createMBeans: Throwable
java.lang.NullPointerException
        at
org.apache.catalina.mbeans.MBeanUtils.createMBean(MBeanUtils.java:346)
        at
org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecy
cleListener.java:284)
        at
org.apache.catalina.mbeans.ServerLifecycleListener.lifecycleEvent(ServerLife
cycleListener.java:169)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:166)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:628)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:497)
        at org.apache.catalina.startup.Catalina.execute(Catalina.java:397)
        at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:200)

Even if no MBean is generated, this shouldn't do that.
We could add some code like this
if (managed == null) {
  // maybe log something
  return;
}
to make this more robust.

Remy


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>