2 Replies Latest reply on Mar 16, 2006 12:45 PM by plutus

    Problem in EJB Calling an MBean

    Bhuvaneswari T Newbie


      I am using JBoss 3.2.7. I have created a helloworld JMX service and deployed the .sar. I am having an .ear from where I am trying to call this MBean.

      I tried in the following ways:

      ArrayList servers = MBeanServerFactory.findMBeanServer(null);
      if (servers == null){}
      MBeanServer server = (MBeanServer)servers.get(0);
      ObjectName objName = new ObjectName("helloworld:service=HelloWorld");

      This gives an exception saying "helloworld is not registered".


      ctx = new InitialContext();
      MBeanServerConnection server = (MBeanServerConnection)ctx.lookup("jmx/invoker/helloworld");

      This gives the exception saying "helloworld not bound".

      I am able to see and change the attributes of the helloworld MBean via jmx-console. But I could not find this MBean in the JNDIViewer.

      Please help me finding out where am I doing wrong.