Results 1 to 3 of 3

Thread: MBeanServer startup confusion

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Posts
    3

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    Nick,

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

    Rob
    Rob Harrop
    Lead Engineer, dm Server
    SpringSource
    http://www.springsource.com

    Co-Author - Pro Spring

  3. #3
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Similar Threads

  1. referencing local MBeanServer on Weblogic 8.1
    By kbaum in forum Management
    Replies: 3
    Last Post: Oct 19th, 2005, 09:43 AM
  2. Replies: 1
    Last Post: Sep 3rd, 2005, 01:55 AM
  3. startup sequence messed up?
    By bpolka in forum Swing
    Replies: 4
    Last Post: Aug 17th, 2005, 01:33 PM
  4. Replies: 1
    Last Post: Aug 16th, 2005, 04:20 AM
  5. JMX and MBeanServer
    By tjdebroy in forum Web
    Replies: 4
    Last Post: Jun 11th, 2005, 10:24 AM

Posting Permissions

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