Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know how to deploy a custom MBean to Tomcat?

So far I`ve found this I copied my jar with my MBean to Tomcat lib directory so the Custom class loader should pick it up. I then followed the instructions but I kept getting the exception below. My MBean does definitely have a public constructor. If I removed the jar from the tomcat lib directory I get the same message which suggests its not picking up my jar or my jar is being loaded after the Apache MBean Modeler is running in Tomcat.

06-Aug-2010 12:14:23 org.apache.tomcat.util.modeler.modules.MbeansSource execute SEVERE: Error creating mbean Bean:type=Bean MBean class must have public constructor at com.sun.jmx.mbeanserver.Introspector.testCreation( at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean( at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean( at com.sun.jmx.mbeanserver.JmxMBeanServer.createMBean( at org.apache.tomcat.util.modeler.modules.MbeansSource.execute( at org.apache.tomcat.util.modeler.modules.MbeansSource.load( at org.apache.catalina.core.StandardEngine.readEngineMbeans( at org.apache.catalina.core.StandardEngine.init( at org.apache.catalina.core.StandardEngine.start( at org.apache.catalina.core.StandardService.start( at org.apache.catalina.core.StandardServer.start( at org.apache.catalina.startup.Catalina.start( at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( at org.apache.catalina.startup.Bootstrap.start( at org.apache.catalina.startup.Bootstrap.main(

share|improve this question

In my tests, this message appeared when class name and the name attribute in the mbeans-descriptors.xml file didn't match.

<mbean name="<your class name here>"

It seems tomcat is searching the constructor by the name attribute.

share|improve this answer

Tomcat MBean support is based on Apache Commons Modeler, which also defines the format of the XML descriptor. See this thread for more pointers.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.