My specific question has to do with JMX as used in JDK 1.6: if I am running a Java process using JRE 1.6 with
com.sun.management.jmxremote
So, the short answer to my question is "no."
However, it's interesting to examine why. Look at the netstat
output from a valid local connection. Here are the ports that I see opened up as a result of a jconsole
making a local connection to itself. As you can see, port 1650 is the local port being used for the JMX information:
Proto Local Address Foreign Address State
TCP Gandalf:1650 Gandalf:1652 ESTABLISHED
TCP Gandalf:1650 Gandalf:1653 ESTABLISHED
TCP Gandalf:1650 Gandalf:1654 ESTABLISHED
TCP Gandalf:1650 Gandalf:1655 ESTABLISHED
TCP Gandalf:1650 Gandalf:1656 ESTABLISHED
TCP Gandalf:1652 Gandalf:1650 ESTABLISHED
TCP Gandalf:1653 Gandalf:1650 ESTABLISHED
TCP Gandalf:1654 Gandalf:1650 ESTABLISHED
TCP Gandalf:1655 Gandalf:1650 ESTABLISHED
TCP Gandalf:1656 Gandalf:1650 ESTABLISHED
However, it's not sufficient to try to connect jconsole
to localhost:1650
. Sadly, all that will net you is a "Connection failed: no such object in table" message.
So, the conclusion of my original story is that, if we are going to facilitate remote monitoring using JMX for our customers, we really need to identify unique individual remote access ports for the variety of Java processes that are started in our system. Fortunately, all this requires is the judicious use of the VM argument:
com.sun.management.jmxremote.port=portNum
where we will almost certainly have a sequential pre-specified range of portNum
so that the customer can select the correct remote application using the port number.