Announcement Announcement Module
Collapse
No announcement yet.
Agent ID of MBean Server Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Agent ID of MBean Server

    Hello,

    i am playing around with JMX and Spring and everything works fine. I have installed a local Tomcat 6.x and now I would like to register a mbean in the mbean server of the tomcat. I can configure the mbean with spring and I can see the mbean with jconsole, but I dont understand one thing:

    How can a expose a mbean in the tomcat mbean server, so how do I get the 'agentId' of the server, in order to expose the mbean exactly in this server?

    My mbeanserver config contains the "locateExistingServerIfPossible" flag. When I opens jconsole, I see a seperate mbean instance with the name of my bean.

    My sample config:

    Code:
    <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
         <!-- indicate to first look for a server -->
         <property name="locateExistingServerIfPossible" value="true"/>
       </bean>
       
      <!-- this bean must not be lazily initialized if the exporting is to happen -->
      <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
      <property name="server" ref="mbeanServer"/>
        <property name="beans">
          <map>
            <entry key="bean:name=testBean1" value-ref="testBean"/>
          </map>
        </property>
      </bean>
    
      <bean id="testBean" class="de.thilko.jmx.TestJmxBean">
        <property name="name" value="TEST"/>
        <property name="threshold" value="100"/>
        <property name="enabled" value="true"/>
      </bean>

    Thanks, for the help,

    Thilko

  • #2
    Solved...

    Hi,

    I found the agent id. You will find the id in the "JMImplementation/MBeanServerDelegate" MBean of the server. Look at the attributes.

    Greetings,

    Thilko

    Comment


    • #3
      How can we 'auto discover' the existing MBean server agentId?

      How can we have the MBeanExporter automatically discover any existing
      MBean server? In the example above, the agentId of tomcat MBean
      server was manually discovered and inserted.

      Tx,

      /U

      Comment


      • #4
        You can specifi in your MbeanServerFactory bean ,the following property:
        <property name="locateExistingServerIfPossible" value="true" />

        Comment

        Working...
        X