[jboss-jira] [JBoss JIRA] Resolved: (EJBTHREE-768) MDB deployment error

Ramil Israfilov (JIRA) jira-events at jboss.com
Thu Nov 9 03:34:42 EST 2006


     [ http://jira.jboss.com/jira/browse/EJBTHREE-768?page=all ]

Ramil Israfilov resolved EJBTHREE-768.
--------------------------------------

    Resolution: Done

according to ejb3 spec: "If the message-driven bean class implements more than one interface other than java.io.Serializable,
java.io.Externalizable, or any of the interfaces defined by the javax.ejb package,
the message listener interface must be specified by the messageListenerInterface element
of the MessageDriven annotation or the messaging-type element of the message-driven
deployment descriptor element."

So in that case class should be annotated like that:
@MessageDriven(name = "EJBExecutorMDB", activationConfig = {
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/certione/ExecutorQueue"),
        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "AUTO_ACKNOWLEDGE"),
        @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "4"),
        @ActivationConfigProperty(propertyName = "SubscriptionDurability", propertyValue = "Durable") },
        messageListenerInterface=MessageListener.class)

> MDB deployment error
> --------------------
>
>                 Key: EJBTHREE-768
>                 URL: http://jira.jboss.com/jira/browse/EJBTHREE-768
>             Project: EJB 3.0
>          Issue Type: Bug
>    Affects Versions: EJB 3.0 RC9 - FD
>         Environment: JDK1.5.0_06, UNIX and windows platforms
>            Reporter: Ramil Israfilov
>             Fix For: EJB 3.0 RC10 - FD
>
>
> I have an MDB which is defined like that
> import javax.jms.MessageListener;
> @MessageDriven(name = "EJBExecutorMDB", activationConfig = {
>         @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
>         @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/ExecutorQueue"),
>         @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "AUTO_ACKNOWLEDGE"),
>         @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "4"),
>         @ActivationConfigProperty(propertyName = "SubscriptionDurability", propertyValue = "Durable") })
> public class EJBExecutorMDB implements MessageListener {
> ....
> It works perfect during in JBOSS, but then I run it in JUNIT it fails with exception: "unable to determine messagingType interface for MDB"
> Only one difference that in JUNIT test I instrument built classes using cobertura - in that case my class implements two interfaces: MessageListener and cobertura interface.
> After looking in source code I found in org.jboss.ejb3.mdb.MDB:
>          if (messagingType.getName().equals(Object.class.getName()))
>          {
>             ArrayList<Class> 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);
>          }
> Why such a dummy check is done ??? Why class must implement one and only one interface ??
> could you check superclasses and allow multiple interfaces implementations on the class.
> Also on the link to forum people has similar problem: they don't implement interface, but extend superclass. And they got the same exception.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list