Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to use JConsole with Tomcat running as windows service

Tags:

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.

like image 407
Kees de Kooter Avatar asked Feb 02 '09 12:02

Kees de Kooter


People also ask

How does JConsole connect to Tomcat as a service?

Connect to the Tomcat service using remote JMX connection. Navigate to the apache-tomcat\bin directory. Rename tomcate6w.exe to jasperserverTomcat.exe, double-click on it to open the Tomcat properties window. In the Java tab add the following properties to the end of the Java Options window and restart the service.

How to run JConsole in windows?

You can access JConsole from the bin directory of the JDK: On a Windows system, start JConsole by double clicking jconsole.exe. You can also select JConsole from the Start menu (if Windchill shortcuts are installed).

How to connect JConsole to remote Process?

To connect JConsole to server process, in the Remote Process section, specify the URL service:jmx:rmi:///jndi/rmi://localhost:2047/fmq and credentials pertaining to the server. Default user name and password are admin and passwd respectively.


1 Answers

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.

like image 135
Ed Thomas Avatar answered Sep 21 '22 09:09

Ed Thomas