8 Replies Latest reply on Nov 8, 2007 3:27 PM by alfred.rsa

    XMBean and SubscriptionList

      Hi

      I have changed my mbeans to xmbeans by having the class extend xmbean. But now my in my *-service.xml the SubscriptionList attribute fails with the following: DeploymentException: No Attribute found with name: SubscriptionList

      this is my xml


      <subscription-list>

      </subscription-list>


      Is this even the right way to add subscriptions for XMBeans? I would actually like the XMBean to subscribe to "global" jmx events and filter them rather than subscribing to specific MBeans

      Regards
      Alfred

        • 1. Re: XMBean and SubscriptionList
          dimitris

          Your xmbean descriptor should describe all operations/attribute that appear on your mbean interface, including:

          <attribute access="read-write" getMethod="getSubscriptionList" setMethod="setSubscriptionList">
           <description>The subscription list configuration/description>
           <name>SubscriptionList</name>
           <type>org.w3c.dom.Element</type>
          </attribute>
          


          • 2. Re: XMBean and SubscriptionList

            Sorry, this is my xml

            <subscription-list>

            </subscription-list>

            • 3. Re: XMBean and SubscriptionList

              Last try...

              <attribute name="SubscriptionList">
               <subscription-list>
               <mbean name="FNB.Commercial.BFLo:service=FileEventListenerService"/>
               </subscription-list>
               </attribute>


              • 4. Re: XMBean and SubscriptionList
                dimitris

                This is the -service.xml descriptor you are showing, not the xmbean one. Better read the xmbean section in the FAQ:

                http://wiki.jboss.org/wiki/Wiki.jsp?page=FAQJBossJMX

                Or the section on how to write listener mbeans.

                Why you are using xmbeans?

                • 5. Re: XMBean and SubscriptionList

                  Hi Dimitris

                  Here is the rest of my config - I only showed the notifications.
                  I am using XMBeans because it seemed to be the most convenient way of adding method/parameter names and descriptions in the JMX console. I tried normal MBeans, dynamic and model mbeans as well. I like XMBeans the best. Should I not use them?

                  <?xml version='1.0' encoding='UTF-8' ?>
                  <!DOCTYPE server PUBLIC "-//JBoss//DTD MBean Service 4.2//EN" "http://www.jboss.org/j2ee/dtd/jboss-service_4_2.dtd">
                  
                  <server>
                   <mbean code="za.co.fnb.bflo.eventlistener.FileEventListenerService" name="FNB.Commercial.BFLo:service=FileEventListenerService" xmbean-dd="META-INF/FileEventListenerService.xml">
                   <depends>jboss.ejb3:service=EJB3Deployer</depends>
                   <attribute name="ConfigurationFilename">FileEventListenerService.xml</attribute>
                   </mbean>
                   <mbean code="za.co.fnb.bflo.dispatcher.JMSEventDispatcherService" name="FNB.Commercial.BFLo:service=JMSEventDispatcherService" xmbean-dd="META-INF/JMSEventDispatcherService.xml">
                   <depends>jboss.ejb3:service=EJB3Deployer</depends>
                   <depends>FNB.Commercial.BFLo:service=FileEventListenerService</depends>
                   <attribute name="ConfigurationFilename">JMSEventDispatcherService.xml</attribute>
                   <attribute name="SubscriptionList">
                   <subscription-list>
                   <mbean name="FNB.Commercial.BFLo:service=FileEventListenerService"/>
                   </subscription-list>
                   </attribute>
                   </mbean>
                  </server>
                  
                  and
                  
                  <?xml version="1.0" encoding="UTF-8"?>
                  
                  <!DOCTYPE mbean PUBLIC "-//JBoss//DTD JBOSS XMBEAN 1.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_2.dtd">
                  
                  <mbean>
                   <description>File listener event service</description>
                   <class>za.co.fnb.bflo.dispatcher.JMSEventDispatcherService</class>
                  
                   <constructor>
                   <description>Default constructor</description>
                   <name>JMSEventDispatcherService</name>
                   </constructor>
                  
                   <attribute access='read-write' getMethod='getConfigurationFilename' setMethod='setConfigurationFilename'>
                   <description>MBean Attribute.</description>
                   <name>ConfigurationFilename</name>
                   <type>java.lang.String</type>
                   </attribute>
                  
                   <operation>
                   <name>start</name>
                   </operation>
                  
                   <operation>
                   <name>stop</name>
                   </operation>
                  
                  </mbean>


                  • 6. Re: XMBean and SubscriptionList
                    dimitris

                    XMBeans are fine. You just need to add the SubscriptionList attribute definition in the xmbean descriptor.

                    • 7. Re: XMBean and SubscriptionList

                      Thanks - I did try that but I couldn't find an example of it, this is what I tried and it didn't work

                      <attribute access='read-write' getMethod='getSubscriptionList' setMethod='setSubscriptionList'>
                       <description>MBean Attribute.</description>
                       <name>SubscriptionList</name>
                       <type>java.util.List</type>
                       </attribute>
                      


                      • 8. Re: XMBean and SubscriptionList

                        I found my mistake, thanks for your patience.

                        The code should be

                        <attribute access='read-write' getMethod='getSubscriptionList' setMethod='setSubscriptionList'>
                         <description>MBean Attribute.</description>
                         <name>SubscriptionList</name>
                         <type>org.w3c.dom.Element</type>
                         </attribute>