PDA

View Full Version : Enabling JMX for Tomcat running as a Windows service


Kees de Kooter
04-02-2009, 11:24
When tomcat is started with the batch file it is recognized by both JConsole and VisualVM as a local proces. No problem there.

However if tomcat is started as a windows service this is not the case. After a lot of tinkering I came to the following solution. In the registry (cough) under key HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Procrun 2.0\node1\Parameters\Java I added the following lines to the Options attribute:


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


Now JConsole can connect as a "Remote process". In VisualVM you add a Local / JMX Connection.

kjkoster
04-02-2009, 12:44
Dear Kees,

Uhm, is there no field for this in the Tomcat tray icon widget thingy?

Kees Jan

Kees de Kooter
04-02-2009, 12:46
Yes there is, on the "Java" tab under "Java Options".