2 Replies Latest reply on Apr 15, 2003 6:57 PM by Eric Jain

    what is a problem with preRegister ()?

    Alexander Rabinowitz Newbie

      I am using JBoss 3.0.6

      here is what I get, whan I register my modelmbean, what extends ModelBase or XMBean:

      MBeanException: preRegister() failed
      [ObjectName='DefaultDomain:type=com.peerdirect.rmapplications.master.jmx.PulsarStandard',
      Class=com.peerdirect.rmapplications.master.jmx.PulsarStandard
      (com.peerdirect.rmapplications.master.jmx.PulsarStandard@5bdc50)]
      Cause: java.lang.NullPointerException
      at
      org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:187)
      at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:975)
      at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:302)
      at com.peerdirect.rmapplications.agent.BaseAgent.(BaseAgent.java:67)
      at com.peerdirect.rmapplications.agent.MasterAgent.(MasterAgent.java:5)
      at com.peerdirect.rmapplications.agent.MasterAgent.main(MasterAgent.java:15)

      Here is how I create the class and register it:
      String pulsarName = "com.peerdirect.rmapplications.master.jmx.PulsarStandard" ;
      Object pulsar = Class.forName (pulsarName).newInstance();
      String name = myMBeanServer.getDefaultDomain() + ":type=" + pulsarName;
      myMBeanServer.registerMBean (pulsar, new ObjectName(name)); // line 67

      preRegister () is called inside registerMBean ().