1 Reply Latest reply on Aug 5, 2007 4:08 PM by Ales Justin

    Using Spring to integrate POJOs as MBeans in JBoss

    Dima Newbie

      I am trying to use Spring to eliminate the need to use SAR XML method descriptors for MBeans (like the following:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE mbean PUBLIC "-//JBoss//DTD JBOSS XMBEAN 1.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_0.dtd">
       <description>Some Services</description>
       <persistence persistPolicy="Never"/>
       <currencyTimeLimit value="0"/>
       <state-action-on-update value="keep-running"/>
       <class>package a.b.AServicesImpl</class>
       <operation impact="ACTION">
       <description>Does something</description>

      and use annotations instead.

      So I have a POJO implementing the logic, and the following XML:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
       <bean id="aServices" class="a.b.AServicesImpl"/>

      I assume that JBoss successfully loads the MBean judging by the following log fragment:

      2007-08-02 19:21:31,656 [ScannerThread] (XmlBeanDefinitionReader.java:347) INFO - Loading XML bean definitions from URL [file:/.../EJBContainer/server/aCong/tmp/deploy/tmp28215jboss-bean-spring.xml]
      2007-08-02 19:21:31,671 [ScannerThread] (AbstractBeanFactoryLoader.java:102) INFO - Bean factory [jboss-bean-spring] binded to local JNDI.
      2007-08-02 19:21:31,671 [ScannerThread] (SpringDeployer.java:134) INFO - Deployed Spring: file:/.../AppServer/mbeans/jboss-bean-spring.xml

      But I do not see this bean in JBoss JMX management console.

      So I guess that either my code isn't annotated properly, or something more profoundly wrong.

      Please, advise (an example would be a great help).

      Thanks a lot in advance.