Results 1 to 2 of 2

Thread: Problem exposing @Service as @ManagedResource

  1. #1
    Join Date
    Nov 2008
    Location
    London, England
    Posts
    19

    Default Problem exposing @Service as @ManagedResource

    I have a service that uses 2.5 annotation-based transactions that's annotation instantiated that I'm trying to expose as an MBean.
    The service works fine but it's not exported as an MBean.

    Is there a known issue with @ManagedResource and AOP proxied classes such as this?

    @Service
    @ManagedResource(objectName="ConnectedDesktop:name =ProductService")
    public class ProductService implements IProductService
    {
    @ManagedAttribute(description="average execution time")
    public int getAverageExecutionTime() { ... }

    @Override
    @Transactional(propagation=Propagation.REQUIRED, isolation=Isolation.READ_COMMITTED)
    public void saveProduct(Product product) { ... }
    }

    My Spring config is as follows:-

    <context:annotation-config/>
    <context:component-scan base-package="com.connecteddesktop"/>
    <tx:annotation-driven/>

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

    <!-- Use this assembler when AMS is not installed -->

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

    <bean id="jmxNamingStrategy" class="org.springframework.jmx.export.naming.Metad ataNamingStrategy">
    <property name="attributeSource" ref="jmxAttributeSource"/>
    </bean>

    <bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporte r">
    <property name="assembler" ref="jmxAssembler"/>
    <property name="namingStrategy" ref="jmxNamingStrategy"/>
    <property name="autodetectModeName" value="AUTODETECT_ASSEMBLER"/>
    </bean>

  2. #2
    Join Date
    Aug 2006
    Posts
    129

    Default

    the mbeanexporter will not pick up your bean since by then it has already been proxied and hence it cannot find any annotation

Tags for this Thread

Posting Permissions

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