Results 1 to 2 of 2

Thread: 'autodetect' config'ed MBeanExporter not working

  1. #1
    Join Date
    Aug 2004
    Posts
    16

    Default '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. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    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

Posting Permissions

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