What I'm trying to do is to use the jconsole utility provided in JDK5 and establish a remote connection to an OC4J instance.
It works a treat when connecting using its local model -- just start OC4J with the following command:
java -Dcom.sun.management.jmxremote=true -jar oc4j.jar The JVM process running oc4j.jar will appear in the local connection tab and can be connected to.
However the remote connection model is presenting more of a challenge at the moment. Using the advanced tab, you can specify the direct JMX Service URL to connect the remote OC4J instance.
Now since OC4J uses its ORMI protocol for remote JMX connections, jconsole needs to be configured with the appropriate libraries and property settintgs to allow it to work over ORMI.
After a bit of trial and error, I captured what I think is the required command to launch jconsole and allow it to work as a remote OC4J client. The OC4J specific settings
Using the advanced connection tab, you can specify the direct JMX Service URL to identify the target server.
To connect remotely to an OC4J process the URL is of the form
So all systems go .... except pressing the connect button results in an exception being thrown on the command line and the connection failing.
Exception in thread "JConsole.addUrl" java.lang.ClassCastException:[Ljava.lang.String;
Which at least when looking at the sunny side, shows that the client side configuration being used here must be close to the mark as OC4J client is being used and the exceptions are coming from OC4J JMX classes.
On the bummer side, it doesn't work!
I wanted to then see what is being passed into our RMIJMXConnector from jconsole and compare it with what we're expecting.
I hunted around for the source code for the JDK5/jconsole but couldn't seem to find it anywhere. Has anyone seen the source for jconsole?
The Mustang (JDK6) source snapshot release looks to include it, but I'm not using Mustang here.
Anyway, I'll keep digging and see how this can be made to work.