1

I am using Spring 3 and exposed an MBean through Spring, everything works fine but I see below warning message in the Log file.

WARN  org.springframework.jmx.support.JmxUtils  - Found more than one MBeanServer instance. Returning first from list.

Here is my configuration:

<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
    <property name="assembler" ref="assembler" />
    <property name="namingStrategy" ref="namingStrategy" />
    <property name="autodetect" value="true" />
    <property name="registrationBehaviorName" value="REGISTRATION_REPLACE_EXISTING"/>
</bean>

<bean id="jmxAttributeSource"
    class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource" />

<bean id="assembler"
    class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler">
    <property name="attributeSource" ref="jmxAttributeSource" />
</bean>

<bean id="WASAdminService" class="com.ibm.websphere.management.AdminServiceFactory"
    factory-method="getAdminService" />

<bean id="namingStrategy" class="com.xxxx.WebSphereNamingStrategy">
    <constructor-arg ref="WASAdminService" />
</bean>

I put a debug point and found that it is finding 'com.ibm.ws.management.PlatformMBeanServer' and 'com.sun.jmx.mbeanserver.JmxMBeanServer' objects. Any idea why it is finding more than one? When I googled, I found that I can specify the 'agent id' to find the required MBean server, but again if we are deploying this code in multiple environments, agent id may not be same (cannot be static)...

Any inputs on this is appreciated...

Thanks, Kiran

Kiran Gunda
  • 73
  • 1
  • 5

1 Answers1

1

My guess is that the two MBean servers correspond to:

  1. the "Platform" MBean server - established by the JVM. This MBean server would have all of the builtin Mbeans, like: java.lang:type=Runtime
  2. the WebSphere provided MBean server - which has MBeans like WebSphere:name=WebContainer,process=...

I'm new to this area, but am just about to investigate further. From my perspective, I'd like to specify the Platform Mbean server - so that it's easier to access from monitoring tools, like JConsole, etc

Evan
  • 101
  • 1
  • 5
  • I get PlatformMBeanServer and Sun's JmxMbeanServer. I don't see I get 'WebContainer' Mbean. I don't load these beans through web-container, rather I load through EJB container (means EJB interceptor initializes the spring application context). However, I found a way to specify in the configuration to use only 'PlatformMBeanServer', My MBean seems getting initialized ok, but I can't see that through JConsole. JConsole couldn't find my Mbean. I am not sure which Mbeanserver Jconsole is loading.. – Kiran Gunda Mar 08 '12 at 06:08