Search code examples
tomcattomcat7jmxtomcat8mbeans

Container level Custom JXM MBean in Tomcat 7+


I need to create a container level JMX MBean for tomcat servers to allow enterprise level monitoring of a few custom features.

The examples I am finding online are focused on webapp level MBeans. I found a few examples for Tomcat 5, but it looks like a lot has changed since then.

How can I register an MBean for an entire Tomcat instance?


Solution

  • I solved by adding the required descriptor AND putting a listener in web.xml for the container. It was necessary to test whether bean already existed in this sceario, since the listener is called for each app in the container.