0 Replies Latest reply on Jun 4, 2007 4:16 PM by Gabriel Weinstock

    [subscription-list: null] message in logs, cannot create a n

    Gabriel Weinstock Newbie

      I'm trying to create an XMBean that listens for notifications from a Timer XMBean. It should simply log the notification and handback when it receives one. However, I never see the logging statement indicating my MBean has started up (or shut down for that matter), and when I look at the logs, I see these entries around my code:

      2007-06-04 15:11:23,960 DEBUG [org.jboss.system.ServiceCreator] About to create xmbean object: domain.com:service=OmsService with code: com.domain.oms.xmbeans.impl.OmsService with descriptor: META-INF/oms-xmbean.xml
      2007-06-04 15:11:23,991 DEBUG [org.jboss.system.ServiceCreator] Created bean: domain.com:service=OmsService
      2007-06-04 15:11:23,991 DEBUG [org.jboss.system.ServiceConfigurator] SubscriptionList set to [subscription-list: null] in domain.com:service=OmsService

      I'm putting all of my class files, the jboss-service.xml, and the oms-xmbean.xml file in a .sar file (oms.sar) and deploying to a JBoss 4.2.0 GA server. Here are the two source code files:


      package com.domain.oms.xmbeans.impl;
      import org.jboss.system.ListenerServiceMBeanSupport;
      import org.jboss.logging.Logger;
      import javax.management.Notification;
      import com.domain.oms.xmbeans.OmsServiceMBean;
      public class OmsService extends ListenerServiceMBeanSupport implements OmsServiceMBean {
       private static final Logger LOG = Logger.getLogger(OmsService.class.getName());
       public OmsService() {
       public String getName() {
       return "OmsService";
       public void startService() throws Exception {
       LOG.info("oms service starting up");
       public void stopService() throws Exception {
       LOG.info("stopping oms service");
       public void handleNotification2(Notification notification, Object handback) {
       LOG.info("got " + notification + ", " + handback);


      package com.domain.oms.xmbeans;
      import org.jboss.system.ListenerServiceMBean;
      public interface OmsServiceMBean extends ListenerServiceMBean {

      And the .xml files:


      <?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">
       <mbean code="com.domain.oms.xmbeans.impl.OmsService" name="domain.com:service=OmsService" xmbean-dd="META-INF/oms-xmbean.xml">
       <attribute name="SubscriptionList">
       <mbean name="jboss.monitor:name=Heartbeat,type=Timer">
       <notification type="jboss.monitor.heartbeat"/>


      <?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">
       <description>oms service</description>
       <description>the default constructor</description>
       <attribute access="write-only" setMethod="setSubscriptionList">

      Can someone tell me what I'm doing wrong? I've been debugging this for the last 4 days and getting nowhere. I can't determine why the subscription-list element is coming back null, or why the service start method is never invoked.

      By the way, I did enable the Timer (heartbeat) service in jboss-monitoring.xml.

      Any help would be SO greatly appreciated,