0 Replies Latest reply on Jan 28, 2009 3:34 AM by J-C jc

    EJB3 MBean does not support NotificationBroadcaster

    J-C jc Apprentice


      I deploy a MBean EJB3

      @Service(objectName = InstrumentManagerMBean.MDBName)
      public class InstrumentManagerImpl extends NotificationBroadcasterSupport
       implements InstrumentManagerMBean {...

      When I try to add a notification listener I have an exception:

      MBeanServer mbs = (MBeanServer) MBeanServerFactory.findMBeanServer(null).iterator().next();
       ObjectName oName = new ObjectName(InstrumentManagerMBean.MDBName);
       mbs.addNotificationListener(oName, new ClientListener(), null, null);

      Exception in thread "main" javax.management.RuntimeOperationsException
       at org.jboss.mx.server.MBeanServerImpl.addNotificationListener(MBeanServerImpl.java:749)
       at fr.biomerieux.nextgen.commandexecutor.Main.main(Main.java:50)
      Caused by: java.lang.IllegalArgumentException: The MBean nextGen:service=InstrumentManagerMBean exists but does not implement the NotificationBroadcaster interface.
       ... 2 more

      Object rerieved in MBeanServerImpl is a ServiceMBeanDelegate . It is a delegate around my MBean. This delegate does not implement the NotificationBroadcaster . Consequently I cannot register to notification listeners.

      Any idea to fix that issue ? I looks like an defect.