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