NickCotter
Aug 18th, 2005, 08:22 AM
Hi,
I'm running into some confusion trying to export my MBeans into an MBean server instance. This is all running under tomcat 4.1
The MBeans themselves appear to be fine, but I appear to be able to either create 2 MBean servers or none at all!
If I use the following context:
<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactory Bean"/>
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry key="bean:name=testMBean1">
<ref bean="testMBean" />
</entry>
</map>
</property>
<property name="server">
<ref bean="mbeanServer" />
</property>
</bean>
I get this warning in the logs:
2005-08-18 13:12:22,343 [main] WARN org.springframework.jmx.support.JmxUtils - Found more than one MBeanServer instance. Returning first from list.
However, if I don't start an mbean server, ie I use the example in the reference documentation:
(http://static.springframework.org/spring/docs/1.2.x/reference/jmx.html#jmx-exporting)
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry key="bean:name=testMBean1">
<ref bean="testMBean" />
</entry>
</map>
</property>
</bean>
I get an error, as it can no longer find any mbean servers:
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'exporter' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.jmx.MBeanServerNotFoundExcepti on: Unable to locate an MBeanServer instance
org.springframework.jmx.MBeanServerNotFoundExcepti on: Unable to locate an MBeanServer instance....
Now I don't know much about tomcat's mbean abilities- especially version 4.1's - is the mysterious other mbean server from tomcat?
Thanks for any help,
Nick Cotter
I'm running into some confusion trying to export my MBeans into an MBean server instance. This is all running under tomcat 4.1
The MBeans themselves appear to be fine, but I appear to be able to either create 2 MBean servers or none at all!
If I use the following context:
<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactory Bean"/>
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry key="bean:name=testMBean1">
<ref bean="testMBean" />
</entry>
</map>
</property>
<property name="server">
<ref bean="mbeanServer" />
</property>
</bean>
I get this warning in the logs:
2005-08-18 13:12:22,343 [main] WARN org.springframework.jmx.support.JmxUtils - Found more than one MBeanServer instance. Returning first from list.
However, if I don't start an mbean server, ie I use the example in the reference documentation:
(http://static.springframework.org/spring/docs/1.2.x/reference/jmx.html#jmx-exporting)
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry key="bean:name=testMBean1">
<ref bean="testMBean" />
</entry>
</map>
</property>
</bean>
I get an error, as it can no longer find any mbean servers:
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'exporter' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.jmx.MBeanServerNotFoundExcepti on: Unable to locate an MBeanServer instance
org.springframework.jmx.MBeanServerNotFoundExcepti on: Unable to locate an MBeanServer instance....
Now I don't know much about tomcat's mbean abilities- especially version 4.1's - is the mysterious other mbean server from tomcat?
Thanks for any help,
Nick Cotter