Pivotal Knowledge Base

Follow

Setting up Tomcat in the Windows platform for monitoring by jconsole or jvisualvm (2008410)

Setting up Tomcat in the Windows platform for monitoring by jconsole or jvisualvm (2008410)

Purpose

When Tomcat is run under a service wrapper in Windows, it is generally inaccessible to local monitoring because the Java process is hidden by the service wrapper.
 
This article provides information on opening a JMX port for access by jconsole, jvisualvm, and other profilers. This approach can also be used to enable monitoring from a remote machine.

Resolution

To enable connections for the Tomcat process on Windows:
  1. Click the Java tab in the Tomcat monitor.
  2. Add these JVM options:

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

    The port number 4321 can be any free port that will be used by the JMX listener.

  3. Stop and restart the Tomcat service.

You can now start jconsole or jvisualvm from a command window (jconsole.exe and jvisualvm.exe are supplied by the JDK) and specify a connection to localhost with the port given for the JMX listener.

Additional Information

Ensure that the remote JMX access is secured as it allows complete control over the server.
 
For more information on securing the JMX connection, see Monitoring and Management Using JMX Technology.

Note: The preceding link was correct as of November 15, 2011. If you find the link is broken, provide feedback and a VMware employee will update the link.

Confidential or Internal Solution information

©VMware 2013

Comments

Powered by Zendesk