views:

4205

answers:

4

I am running tomcat 6.0.18 as a windows service. In the service applet the jvm is configured default, i.e. it is using jvm.dll of the JRE.

I am trying to monitor this application with JConsole but cannot connect to it locally. I added the parameter -Dcom.sun.management.jmxremote (which works when starting tomcat with the start.bat script). But the jvm does not seem to pick up the parameter.

+1  A: 

Here's the prescribed way for changing jvmoptions & interacting with the service:

http://tomcat.apache.org/tomcat-5.5-doc/windows-service-howto.html

I would try going into your registry at HKLM/Software/Apache Software Foundation/Procrun 2.0//Parameters/Java and editing the "Options" multi-string value directly.

Ron
+6  A: 

There's a nice GUI to edit the options, no need to muck around in the registry.

Open up the C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin\tomcat6.exe (or just double-click on the monitor icon in the task bar). Go to the Java pane, add the following to the list of arguments, and restart Tomcat.

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

Then you can connect with JConsole or the newer VisualVM.

Ed Thomas
A: 

If Tomcat is running as a Windows service, and you want to attach to the JVM locally, you need to run VisualVM or JConsole as the System account. You can use Sysinternals PsExec.exe to accomplish this.

psexec.exe -i -s c:\visualvm\bin\visualvm.exe
Patrick
A: 

I'm posting it mainly to record this information to myself, I haven't validated it - but this is supposed to work as well:

http://mysqlandsqlserver.blogspot.com/2010/02/jconsolejmap-and-tomcat-as-windows.html

ripper234