Results 1 to 4 of 4

Thread: Agent ID of MBean Server

  1. #1
    Join Date
    May 2007
    Posts
    6

    Default 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. #2
    Join Date
    May 2007
    Posts
    6

    Lightbulb 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

  3. #3

    Default 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

  4. #4
    Join Date
    May 2007
    Location
    Craiova, Romania
    Posts
    25

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •