Remote jconsole JMX using mystery port

I am trying to use jconsole to monitor a JVM running on a remote machine. I am doing this over ssh. So I told the remote JVM to start with

-Dcom.sun.management.jmxremote.ssl=false

-Dcom.sun.management.jmxremote.authenticate=false

-Dcom.sun.management.jmxremote.port=8010

also I happen to have set

-Djava.rmi.server.hostlame=localhost

but I don't think that is relevant

Then I forwarded the port 8010 to the remote machine and connect with

jconsole localhost:8010

But that did not work. So I go to linux box and type

netstat -atnp | grep java

which reveals that Java is listening also on port 32796

I start and stop my process a few time to see that this is a randomly chosen port. I then use ssh to forward this port and voila, jconsole is now working across ssh.

Anyone have any idea what this mystery port is and any way to set it on the command line of the monitored JVM?

[960 byte] By [_dnoyeBa] at [2007-11-26 15:15:20]
# 1
Have a look at the following link:<a href=" http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html#gdjou">Monitoring Applications through a Firewall</a> in the Java SE Monitoring and Management Guide.Regards,Luis
lmalventa at 2007-7-8 9:07:02 > top of Java-index,Core,Monitoring & Management...
# 2
Wonderful! I've been looking for a solution to run jconsole through ssh tunnel for days.If there is a way to configure the JVM with the JMXConnectorServer parameters that would be even better./Roland
rolandnygrena at 2007-7-8 9:07:02 > top of Java-index,Core,Monitoring & Management...