Today I needed to use JConsole to connect up to a JBoss instance running ColdFusion and Railo. I wanted to see thread usage etc. when starting the application I’m working on.
In the past when I’ve used JConsole, it used to automatically detect the running JVMs and show them in the startup dialog box. However, today I wasn’t seeing the running JVMs.
I could connect using the Advanced option in JConsole and by putting in the JMX Connector URI. But connecting like that means that JConsole does not provide information on threads/memory etc. — stuff I wanted to see.
After a bit of digging around I found that you need to pass the following arguments to the JVM that you want to monitor in JConsole:
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false
Once I added these JVM arguments and restart my JBoss instance, JConsole automatically detected running JVMs.
Normally JConsole should automatically detect running JVMs. But I believe this has to do with the fact that I was using Java version 1.5.0_16. If you are using Java 6, you shouldn’t need to do this.