Announcement Announcement Module
No announcement yet.
MBeans not appearing in Tomcat Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • MBeans not appearing in Tomcat


    I have tried to follow the instructions of Chapter 20 (section 20.2) where I have created a simple class (below) and tried to pass it to the MBeanExporter. I want my MBean to be exposed Tomcat's MBeanServer, so as instructed in Section 20.2.1, since an MBeanServer already exists I only need to specify the exporter.

    When I start up the application, in the logs I see no exceptions and I see these lines, which seem to indicate that it is doing something JMX related:

    23-Jan-2009 20:42:03 org.springframework.jmx.export.MBeanExporter afterPropertiesSet
    INFO: Registering beans for JMX exposure on startup
    23-Jan-2009 20:42:03 org.springframework.jmx.export.MBeanExporter registerBeanInstance
    INFO: Located managed bean 'bean:name=testMgmt1': registering with JMX server as MBean [bean:name=testMgmt1]

    However, when I start JConsole and attach to the Tomcat Bootstrap process, I only find the default MBean hierarchy (JMImplementation,, java.lang and java.util.logging). I couldnt find my MBean or any Spring related bean anywhere. Am I doing something completely wrong?

    Environment: Win XP SP2, Tomcat 6.0.18, JDK 1.6.0_07, Spring 2.5.5

    Spring Application Context:

     <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
            <property name="beans">
                <entry key="bean:name=testMgmt1" value-ref="testMgmt"/>
        <bean id="testMgmt" class="">
    MBean Interface:

    public interface ITestMgmtMBean
      public String greet();
    The actual class to be exposed:

    public class TestMgmtMBean implements ITestMgmtMBean
      public TestMgmtMBean()
      public String greet()
        return "Hello!";

  • #2
    Just a small clarification on the above.

    I noticed that when I specify the JMX management port using -D and attach to it using the IP address and port I see my MBean and also the tomcat MBeans.

    Any idea why the process I am attaching to locally to the only MBeanServer I see (the tomcat Bootstrap loader) doesnt show my MBeans? Why is this different than what I see when I connect to the MBeanServer remotely?