2 Replies Latest reply on Dec 5, 2003 11:49 AM by bmadigan2003

    NullPointerException in ModelMBeanInvoker during startup

    bmadigan2003 Newbie

      I have defined an XMBean following the JBoss admin and developer guide examples (starting at Page 119)

      The XMBean descriptor validates ok against it's DTD, and I don't find any discrepencies between the descriptor and the implementing class.

      During initialization, the XMBean fails to start, throwing a NullPointerException during registration

      Relevant portion of the stack trace is below:

      [java] Caused by: java.lang.NullPointerException
      [java] at org.jboss.mx.modelmbean.ModelMBeanInvoker.preRegister(ModelMBeanInvoker.java:243)
      [java] at javax.management.modelmbean.RequiredModelMBean.preRegister(RequiredModelMBean.java:218)
      [java] at org.jboss.mx.modelmbean.ModelMBeanInvoker.preRegister(ModelMBeanInvoker.java:284)
      [java] at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:148)
      [java] at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      [java] at org.jboss.mx.interceptor.ObjectReferenceInterceptor.invoke(ObjectReferenceInterceptor.java:59)
      [java] at org.jboss.mx.interceptor.MBeanAttributeInterceptor.invoke(MBeanAttributeInterceptor.java:43)
      [java] at org.jboss.mx.interceptor.PersistenceInterceptor2.invoke(PersistenceInterceptor2.java:93)
      [java] at org.jboss.mx.server.MBeanInvoker.invoke(MBeanInvoker.java:75)
      [java] at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:141)
      [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      [java] at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:994)
      [java] at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:954)
      [java] at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:322)
      [java] at org.jboss.system.ServiceCreator.install(ServiceCreator.java:114)
      [java] at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:155)
      [java] at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:118)

      Any ideas on what I am doing that could cause this?
      Poking around in the source code (3.2.1), the only two lines in preRegister( ) that are likely to be causing a nullPointerException are these:

      Descriptor mbeanDescriptor = infoSupport.getMBeanDescriptor();

      mbeanDescriptor.setField(.......
      ....

      Either mbeanDescriptor or infoSupport is null (I don't think the CVS version I was looking at is the right one, so I went with the method name instead of trusting the line number)

      I could not attach the xml xmbean descriptor file due to an error in this site.