[jboss-user] [EJB 3.0] - EJB3 MBean does not support NotificationBroadcaster

jc7442 do-not-reply at jboss.com
Wed Jan 28 03:34:31 EST 2009


I use EMBEDDED_JBOSS_BETA3

I deploy a MBean EJB3
@Service(objectName = InstrumentManagerMBean.MDBName)
  | @Management(InstrumentManagerMBean.class)
  | 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);
  |            System.out.println(mbs.isRegistered(oName));
  |            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. 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4205142#4205142

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4205142



More information about the jboss-user mailing list