Forum Stats

  • 3,876,244 Users
  • 2,267,083 Discussions
  • 7,912,479 Comments

Discussions

Cannot connect to a local JVM with JMC - unexpected IP in error message

Silver QUETTIER
Silver QUETTIER Member Posts: 2
edited May 22, 2018 11:56AM in Java Mission Control

Hello,

I'm struggling to connect to a local JVM with the JMX Console invoked by JMC.

The local app I want to monitor is launched by the following command:

java -Xms1024m -Xmx1024m -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=7091 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -cp %classpath% my.fully.qualified.ClassName

The JVM is discovered by JMC under local processes.

Connecting through the detected process results in the following:

Could not connect to [1.8.0_162] my.fully.qualified.ClassName (9100) : Connection refused to host: 192.168.56.1; nested exception is:

java.net.ConnectException: Connection timed out: connect

Could not connect to [1.8.0_162] my.fully.qualified.ClassName (9100). Make sure the JVM is running and that you are using the correct protocol in the Service URL (service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc3AAtVbmljYXN0UmVmMgAADDE5Mi4xNjguNTYuMQAAz7k5I+/bmeEL9Opvhf8AAAFjaWMcfIACAHg=).

Connecting through a custom connection to localhost:7091 results in the following:

Could not connect to localhost : Connection refused to host: 192.168.56.1; nested exception is:

java.net.ConnectException: Connection timed out: connect

Could not connect to localhost. Make sure the JVM is running and that you are using the correct protocol in the Service URL (service:jmx:rmi:///jndi/rmi://localhost:7091/jmxrmi).

I have no idea what is going wrong, or from where the 192.168.56.1 host comes from.

Any ideas?

Silver QUETTIER

Best Answer

  • Hirt-Oracle
    Hirt-Oracle Member Posts: 268
    edited May 16, 2018 11:30AM Answer ✓

    Looks like your rmi hostname binds to 192.168.56.1. Try setting it explicitly (on the server) using the java.rmi.server.hostname system property (to what the client would be expected to use to find the server).

    Silver QUETTIERSilver QUETTIER

Answers

This discussion has been closed.