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?