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.
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.
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
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.