2 Replies Latest reply on Aug 31, 2015 11:08 AM by mayerw01

    Is it feasible to connect tojmx rmi service using old method ?

    shyam9433

      Is there any way to connnect to JMX RMI Service of JBOSS with "<service:jmx:rmi://127.0.0.1/jndi/rmi://127.0.0.1:9999>",

      In case above is not possible,

      can you point out a Sample Java Code for Connecting to JBOSS with "service:jmx:http-remoting-jmx://<server_host_or_ip>:9990 " method.

        • 1. Re: Is it feasible to connect tojmx rmi service using old method ?
          shyam9433

          And is this change generic, say for tomcat also..or only wildfly.

          • 2. Re: Is it feasible to connect tojmx rmi service using old method ?
            mayerw01

            The exact format of the service:jmx depends on the server version.

            But you may use a structure like this:

             

            public class JMXExample { 

             

                public static void main(String[] args) throws Exception {

             

                   String urlString ="service:jmx:remoting-jmx://" + host + ":" + port;

                   JMXServiceURL serviceURL = new JMXServiceURL(urlString);

                   JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, null);

             

                    System.out.println("Connected to: "+ jmxConnector);

                    System.out.println(jmxConnector.getMBeanServerConnection().getMBeanCount() + " MBeans");

             

                    jmxConnector.close();

                }