In this post i will show you 3 steps to connect Jconsole to remote Tomcat7 from Windows-7.
Jconsole tool is a JMX ready GUI tool for monitoring a Java virtual machine. Using this tool, you can monitor real-time status of your application server threads, memory,cpu,MBeans, active sessions etc.
My Local machine environment is below
- Local JDK -> JDK 1.7
- Operating System -> Windows7 64-bit
My Remote server details
- Remote JDK -> JDK 1.7
- Operating system -> Linux
- Application server -> Tomcat-7.0.63
STEP1: Download & Install JDK 1.7 from Oracle website onto your Windows desktop
Here is the link to download Click Here
STEP2: Enable JMX access on your remote Tomcat server
To enable JMX access, you need to edit catalina.sh which can be found inside $CATALINA_HOME/bin/ directory.
Edit catalina.sh & append following JVM parameters to JAVA_OPTS. On my server, this entry was located in line #98
JAVA_OPTS="${JAVA_OPTS} -Xms2048M -Xmx2048M -Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9991
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=20.20.20.20
STEP3: Launch Jconsole on your Windows desktop from command prompt using below command.
jconsole -J-Djava.util.logging.config.file=logging.properties
If you want to enable logging for debugging purpose, you can enable it using below method.
my logging.properties looks like below
logging.properties
handlers = java.util.logging.ConsoleHandler
.level = INFO
java.util.logging.ConsoleHandler.level = FINEST
java.util.logging.ConsoleHandler.formatter =
java.util.logging.SimpleFormatter
// Use FINER or FINEST for javax.management.remote.level - FINEST is
// very verbose...
javax.management.level = FINEST
javax.management.remote.level = FINER
Once everything is setup, You can start Jconsole & connect to your Tomcat JMX port as shown below.