Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tomcat used for JMX management

Status
Not open for further replies.

tony17

Programmer
May 11, 2004
10
IT
I wonder if tomcat (and only tomcat) is sufficient for JMX management of Web Services deployed on it.

Thanx, Tony
 
The later versions of tomcat are completely run off the back of JMX, so yes, you can use JMX within Tomcat. Bear in mind, Tomcat uses mx4j, so if you don't want to use that, you should overwrite the CATALINA_HOME/bin/jmx.jar file with your desired jmx implementation.



--------------------------------------------------
Free Database Connection Pooling Software
 
This is to sedj, or anyone else who can help. Can you give me some more info on how to use JMX and Tomcat to manage my own servlets running in Tomcat? It seems that I need to edit conf/server.xml to specify a list of mbean-descriptor.xml files. But I cannot find any documentation on what an mbean-descriptor.xml file looks like. Can you help? Thanks.
 
There are three main ways of using JMX in Tomcat.

1) Just write your JMX managed code, and kick it off via a servlet.
2) Go via the mbean-descriptor.xml method, and have Tomcat load your classes.
3) Get tomcat to load your classes by implementing a Factory and adding an entry for <ResourceParams> in <GlobalNamingResources> section of server.xml

Here is a how-to for option 2 :



--------------------------------------------------
Free Database Connection Pooling Software
 
Thanks sedj. I've already attempted option 2, but the Tomcat documentation you point to is not enough for my little mind. It says to configure conf/server.xml to include my own mbeans-descriptor.xml file. I've done that, and I've also instrumented my servlet classes with appropriate MBeans, but I don't know how to write the mbeans-descriptor.xml file, and can find no documentation or examples.

First things first, is it true that I can instrument my servlet classes with MBeans and then have those MBeans exposed via Tomcat and JMX to the JDK 1.5 jconsole app?

If so, then your option 2 seems the best way to go, but it seems that I need a hand-holding example of how to do it all, step by step. Do you know of one? Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top