I have a web application deployed to a remote resin server, and it has JMX turned on.
I can telnet to the remote server i.e
franz@see:/tmp$ telnet &l
If you are accessing a machine behind a firewall, you need to open both JMX and RMI ports.
In this context, you are much better off forcing the value for RMI than relying on the auto assigned
In my case, I was trying to access Tomcat so I had to do the following:
#!/bin/sh
CATALINA_OPTS="$CATALINA_OPTS -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8008 -Dcom.sun.management.jmxremote.rmi.port=8007 -Dcom.sun.
management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
and then
firewall-cmd --zone=public --add-port=8008/tcp --permanent
firewall-cmd --zone=public --add-port=8007/tcp --permanent
firewall-cmd --reload
This finally made it work for me : Giving this extra option: -Djava.rmi.server.hostname=<ip addres where jvm is running
So all the vm arguments used to open jconsole from a remote machine, the jvm on the remote machine must be started with
-Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=<port> -Dcom.sun.management.jmxremote -com.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=<ip address>
The entire process is listed here