2006-05-15

Tomcat and JConsole

If you are running Tomcat as a service, you will not be able to attach to it using JConsole using the 'local' protocol.  You must configure it to accept remote connections, e.g.

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8081
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

This recipe does not perform any authentication.  Also, I found out that if you have any -X Java options, they must appear last.  When I tried to put the various -D settings listed above after the -X options, Tomcat (and presumably the JVM) quietly ignored them all.