Announcement Announcement Module
Collapse
No announcement yet.
'autodetect' config'ed MBeanExporter not working Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 'autodetect' config'ed MBeanExporter not working

    Hi, I've the following bean config file, essentialy lifted from the JMX section in the online docs:

    <!-- this config will grab and export any JMX annotated beans -->
    <beans>
    <bean id="exporter" class="org.springframework.jmx.export.MBeanExporte r">
    <property name="assembler" ref="assembler"/>
    <property name="autodetect" value="true"/>
    </bean>
    <bean id="attributeSource"
    class="org.springframework.jmx.export.metadata.Att ributesJmxAttributeSource">
    <property name="attributes">
    <bean class="org.springframework.metadata.commons.Common sAttributes"/>
    </property>
    </bean>
    <bean id="assembler" class="org.springframework.jmx.export.assembler.Me tadataMBeanInfoAssembler">
    <property name="attributeSource" ref="attributeSource"/>
    </bean>
    </beans>

    I'm getting the following exception, even though autodetect is set to true:

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'exporter' defined in ServletContext resource [/WEB-INF/classes/services-jmx.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Must specify at least one bean for registration
    java.lang.IllegalArgumentException: Must specify at least one bean for registration.

    I've a bean defined in another config file, that uses the JDK 1.5 annotations. I thought this config would search the bean container for any JMX annotated beans. But in any case, even if it's not finding my bean not sure why i'm getting the exception with autodetect on.

  • #2
    Turn on logging and you'll see what happens underneath. I assume that is as you said - no beans are discovered and the server registration fails.

    Comment

    Working...
    X