4 Replies Latest reply on Dec 22, 2011 5:58 AM by Alexis Hassler

    How to access JMX via a firewall on AS 7

    Alexis Hassler Apprentice



      I'm trying to install a JBoss AS 7 on a EC2 instance. Everything is working fine except JMX access.


      My server has a LAN IP address wich is different from the IP address used to acces to the server. I've change the interfaces (management and public) to any-address.


      I'm trying to access to JMX with the following code, using the public address :



              String host = "ec2-100-20-180-80.compute-1.amazonaws.com";

              int port = 1090;


              String urlString = System.getProperty("jmx.service.url",

                      "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/jmxrmi");

              JMXServiceURL serviceURL = new JMXServiceURL(urlString);

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

              MBeanServerConnection connection = jmxConnector.getMBeanServerConnection();{code}


      I get the following message :


      Exception in thread "main" java.rmi.ConnectException: Connection refused to host:; nested exception is:



      Of course, it cannot work as is the local IP of my server.


      I've tried to add some properties, but it didn't work.




      How could I do to access to my server with JMX ?