0 Replies Latest reply on Jun 26, 2012 9:58 AM by Francois Billard

    Jmx client issue inside JBoss servlet

    Francois Billard Newbie

      Hi,

       

      i have a jmx client to get attributes on servers, it works well in standalone program :

      here is the code :

       

           ObjectName objectName = new ObjectName("jgroups:type=protocol,cluster=\"cluster\",protocol=GMS");

           JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://192.168.47.23:50000/jmxrmi");

           JMXConnector jmxc = JMXConnectorFactory.connect(url, null);

           MBeanServerConnection connection = jmxc.getMBeanServerConnection();

           Object result =(Object) connection.getAttribute (objectName, "LocalAddress");

       

      but the same code does not work when i put it inside servlet (JBoss 7.1) :

      i get this issue :

       

      Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: rmi://192.168.47.23:50000/jmxrmi -- service jboss.naming.context.java.rmi:."192.168.47.23:50000".jmxrmi

       

      and

       

      Caused by: javax.naming.NameNotFoundException: rmi://192.168.47.23:50000/jmxrmi -- service jboss.naming.context.java.rmi:."192.168.47.23:50000".jmxrmi

       

      it s so simple, i miss something ?

      Thanks

       

      Francois