3 Replies Latest reply on Nov 6, 2006 11:52 AM by mwelss

    4.0.5.GA & EJB3.0RC9 Message Bean Issue

    pshrimpton

      Hi,

      Not sure if this is the correct forum, but...

      Had a problem with message beans in 4.0.5.GA & EJB3.0RC9 (they worked fine in 4.0.4.GA & EJB3.0RC8)

      During deployment all Meassage beans failed to deploy with the error message...

      java.lang.RuntimeException: unable to determine messagingType interface for MDB
      at org.jboss.ejb3.mdb.MDB.getMessagingType(MDB.java:88)
      at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.resolveMessageListener(JBossMessageEndpointFactory.java:241)
      at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.start(JBossMessageEndpointFactory.java:184)
      at org.jboss.ejb3.mdb.MessagingContainer.startProxies(MessagingContainer.java:185)
      at org.jboss.ejb3.mdb.MessagingContainer.start(

      The problem turned out to be that all my message beans had a common parent that implemented javax.jms.MessageListener..

      public abstract class AbstractMessageBean implements javax.jms.MessageListener {}

      public class ConcreteMessageBean extends AbstractMessageBean {}

      ..and for some reason jboss did not think my ConcreteMessageBean implemented MessageListener. Implementing the MessageListener inteface again on my ConreteMessageBeans seams to have fixed this issue, e.g...

      public class ConcreteMessageBean extends AbstractMessageBean implements MessageListener {}

      Is this a bug?

      Cheers
      Phil



        • 1. Re: 4.0.5.GA & EJB3.0RC9 Message Bean Issue

          I have similar issue with my MDB. I also got such exception, but strange thing that on my class I have implements javax.jmx.MessageListener.

          After some debugging and looking in source code of EJB3 probably I found the cause of problem. this exception is thrown from
          org.jboss.ejb3.mdb.MDB.java:
          ArrayList list = ProxyFactoryHelper.getBusinessInterfaces(clazz);
          if (list.size() > 1 || list.size() == 0) throw new RuntimeException("unable to determine messagingType interface for MDB");
          messagingType = list.get(0);


          As you see it gets all implemented interfaces of your class (and don't get interfaces of parent class probably) and if it is empty (as in your case) or if it is more than one interface on class (as in my case, because I have another interface on my class) exception is thrown.

          I will create issue in jira.

          • 2. Re: 4.0.5.GA & EJB3.0RC9 Message Bean Issue
            • 3. Re: 4.0.5.GA & EJB3.0RC9 Message Bean Issue
              mwelss

              We had the same problem, but adding

              messageListenerInterface=MessageListener.class

              to the MessageDriven annotation fixes it.

              It's what the spec requires...

              Cheers,

              Martin