Announcement Announcement Module
Collapse
No announcement yet.
MBeanServer startup confusion Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • MBeanServer startup confusion

    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.MBeanServer FactoryBean"/>

    <bean id="exporter" class="org.springframework.jmx.export.MBeanExporte r">
    <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/sp...#jmx-exporting)

    <bean id="exporter" class="org.springframework.jmx.export.MBeanExporte r">
    <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

  • #2
    Nick,

    What VM are you running on? It seems that you would get 0 or 2 MBeanServers

    Rob

    Comment


    • #3
      I had similar problems in the past especially with JDK 1.5 where it's possible to make the VM start it's own server. First of all make sure you don't start teh server through the JDK, then check out your tomcat configuration - I think tomcat 4.1 also has some ways of creating the server.
      Most likely you are using jdk 1.5 which starts it's own server that creates the conflict.

      Comment

      Working...
      X