Forums Register Login

JMX with Tomcat

+Pie Number of slices to send: Send
Hello ranchers,
I have installed tomcat 6 with installer on Windows machine. I am not able to use Jconsole to connect to tomcat to see the registered MBeans. How do I connect to tomcat with Jconsole. Also how do i integrate the JMX with tomcat. Kindly reply. I am using jdk 1.6.

Regards,
Pradeep
+Pie Number of slices to send: Send
Not sure what you mean by "integrate the JMX with Tomcat", but if you want to connect from JConsole to TC then you need to start TC with the "-Dcom.sun.management.jmxremote" property. The easiest way to do that would be to add a line like CATALINA_OPTS="-Djava.awt.headless=true -Dcom.sun.management.jmxremote" at an appropriate location to the bin/catalina.bat script.
+Pie Number of slices to send: Send
 

Ulf Dittmer wrote:The easiest way to do that would be to add a line like CATALINA_OPTS="-Djava.awt.headless=true -Dcom.sun.management.jmxremote" at an appropriate location to the bin/catalina.bat script.



I have installed tomcat using the installer where in i do not have an option to edit the catalina.bat file. In this case how do I connect JConsole with TC?
+Pie Number of slices to send: Send
You can use the "Configure Tomcat" shortcut that is created for you. Go to the "Java" tab, you can then add a new line to the "Java Options" field. It is recommended to use one line for each option so it will be a bit clearer where one option ends and the next one starts. For instance, I only added "-Dcom.sun.management.jmxremote" there and now I can see the memory MBeans in Lambda Probe. I couldn't get JConsole to connect to it yet but that has something to do with the security settings.

My full content of the "Java Options" field:
+Pie Number of slices to send: Send
I am able to configure the tomcat with JConsole. But I am not able to view the Mbeans deployed in tomcat using JConsole. How do I register in tomcat server and view the MBeans in jconsole. I tried using RMIconnector and I was able to see the deployed mbeans on tomcat using JConsole. The jsp code is given below for reference.



An in the JConsole i connected using the remote process giving the service:jmx:rmi:///jndi/rmi://<hostname>:8999/server value. Also I had started the rmi registry on 8999 port. I am not able to connect to tomcat directly. Kindly help me where I am going wrong.

+Pie Number of slices to send: Send

Finally I was able to rectify the issue. The problem was with setting CATALINA_OPTS in proper location. ;-)
And inside of my fortune cookie was this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3699 times.
Similar Threads
using jconsole
What is the class WSLauncher needed for?
Tomcat Server monitoring
JConsole - Remote connect
How to monitor dynamic values in JMX !!
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 06:58:43.