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

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

book

Article ID: 297365

calendar_today

Updated On:

Products

Support Only for Apache Tomcat

Issue/Introduction

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.

Environment


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 29, 2018. If you find the link is broken, provide feedback and a Pivotal employee will update the link.

Confidential or Internal Solution information