Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-63

MDBs do not deploy if they inherit MessageListener interface

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 6.2.0.GA
    • EJB
    • Hide

      Here's a simple code example that illustrates the issue (this is a small modification of the "helloworld-mdb" quickstart example):

      Interface:

      import javax.jms.MessageListener;

      public interface HelloWorldQueue extends MessageListener {
      }

      Implementation:

      @MessageDriven(name = "HelloWorldQueueMDB", activationConfig =

      { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/HELLOWORLDMDBQueue"), @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") }

      )

      public class HelloWorldQueueMDB implements HelloWorldQueue {

      public void onMessage(Message rcvMessage) {
      // method body goes here....
      }
      }

      Show
      Here's a simple code example that illustrates the issue (this is a small modification of the "helloworld-mdb" quickstart example): Interface: import javax.jms.MessageListener; public interface HelloWorldQueue extends MessageListener { } Implementation: @MessageDriven(name = "HelloWorldQueueMDB", activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/HELLOWORLDMDBQueue"), @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") } ) public class HelloWorldQueueMDB implements HelloWorldQueue { public void onMessage(Message rcvMessage) { // method body goes here.... } }

    Description

      If MDB implementations implement an interface that extends the MessageListener interface, they do not deploy. If your implementation class implements MessageListener directly, or extends a class that implements MessageListener, the bean deploys without issue.

      Stack trace snippet:
      14:47:41,774 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-14) MSC000001: Failed to start service jboss.deployment.unit."jboss-helloworld-mdb.war".component.HelloWorldQueueMDB.CREATE: org.jboss.msc.service.StartException in service jboss.deployment.unit."jboss-helloworld-mdb.war".component.HelloWorldQueueMDB.CREATE: Failed to start service
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]
      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
      Caused by: java.lang.IllegalStateException: JBAS014521: No message listener of type org.jboss.as.quickstarts.mdb.HelloWorldQueue found in resource adapter hornetq-ra
      at org.jboss.as.ejb3.component.EJBUtilities.createActivationSpecs(EJBUtilities.java:105)

      Please see the link to the thread on the forums for sample code and the full stack trace.

      Very similar to AS7-2638

      Attachments

        Activity

          People

            rhn-engineering-cdewolf Carlo de Wolf
            jamiebez_jira Jamie Beznoski (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: