1 Reply Latest reply on Mar 12, 2004 5:00 PM by Thomas Lauerbach

    NullpointerException in isRegistered

    Thomas Lauerbach Newbie

      Hi all,
      I get very strange behaviour in the following code. The method mBeanServer.isRegistered throws a nullpointerexception.
      I am using JBoss 3.2.2 in SDK 1.4 (java.runtime.version: 1.4.0-b92)



      **** CODE ****

      ArrayList servers = MBeanServerFactory.findMBeanServer(null);
      MBeanServer mBeanServer= (MBeanServer)servers.get(0);
      System.out.println( servers.size()+" MBeanservers available");

      ObjectName on = new ObjectName( ttEntity.getImplMBeanName());

      System.out.println("MBean: "+ttEntity.getImplMBeanName()+" "+InteractiveTaskImplementation.class.getName()+" "+on+" "+mBeanServer);
      if ( !this.mBeanServer.isRegistered( on) ) {
      throw new EngineException("Implementation MBean "+ttEntity.getImplMBeanName()+" is not registered.");
      }
      if ( this.mBeanServer.isInstanceOf( on, InteractiveTaskImplementation.class.getName())) {
      return new InteractiveTaskMBeanBridge( this.mBeanServer, on);
      }


      **** /CODE ****


      **** server.log ****

      2004-03-12 10:19:00,502 INFO [STDOUT] 1 MBeanservers available
      2004-03-12 10:19:05,237 INFO [STDOUT] MBean: workflow:tasktype=JcmsEdit com.lauerbach.workflowengine.ejb.InteractiveTaskImplementation workflow:tasktype=JcmsEdit org.jboss.mx.server.MBeanServerImpl@a9c09e
      2004-03-12 10:19:06,596 ERROR [STDERR] java.lang.NullPointerException
      2004-03-12 10:19:06,596 ERROR [STDERR] at com.lauerbach.workflowengine.ejb.InternalToken._$9843(InternalToken.java:187)
      2004-03-12 10:19:06,596 ERROR [STDERR] at com.lauerbach.workflowengine.ejb.InternalToken.(InternalToken.java:95)
      2004-03-12 10:19:06,596 ERROR [STDERR] at com.lauerbach.workflowengine.ejb.InternalToken.(InternalToken.java:57)
      2004-03-12 10:19:06,612 ERROR [STDERR] at com.lauerbach.workflowengine.ejb.EngineFacadeBean.executeTaskQueue(EngineFacadeBean.java:554)
      2004-03-12 10:19:06,612 ERROR [STDERR] at com.lauerbach.workflowengine.ejb.EngineFacadeBean.executeTask(EngineFacadeBean.java:507)
      2004-03-12 10:19:06,612 ERROR [STDERR] at com.lauerbach.workflowengine.ejb.EngineFacadeBean.startThread(EngineFacadeBean.java:629)
      2004-03-12 10:19:06,627 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2004-03-12 10:19:06,627 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      2004-03-12 10:19:06,627 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2004-03-12 10:19:06,627 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)


      **** /server.log ****