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


Reply With Quote