4 Replies Latest reply on Jul 31, 2012 2:24 AM by Mayank Gupta

    MDB Deployment using Eclipse with AS7.1

    Laura delli Paoli Master

      Hello everybody!

      I successfully developped a Producer Consumer application and deployed it in Eclipse IDE by adding it to my jBoss AS 7.1 server.

       

      My MDB is:

      @MessageDriven(activationConfig = {

                          @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),

                          @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/TestQ") })

      public class QueueReader implements MessageListener {

      .....

       

      Now I have to change my app in order to use ejb-jar.xml to configure my MDB so I changed my MDB in:

      @MessageDriven

      public class QueueReader implements MessageListener

       

      and I wrote the following ejb-jar.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <ejb-jar

                xmlns="http://java.sun.com/xml/ns/javaee"

                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"

                version="3.1">

                     <enterprise-beans>

                                    <message-driven>

                                                   <ejb-name>JBossQueueReader</ejb-name>

                                                   <ejb-class>reader.QueueReader</ejb-class>

                                                   <transaction-type>Container</transaction-type>

                                                   <activation-config>

                                                                  <activation-config-property>

                                                                            <activation-config-property-name>destinationType</activation-config-property-name>

                                                                            <activation-config-property-value>javax.jms.Queue</activation-config-property-value>

                                              </activation-config-property>

                                                                  <activation-config-property>

                                                                            <activation-config-property-name>destination</activation-config-property-name>

                                                    <activation-config-property-value>queue/TestQ</activation-config-property-value>

                                                                  </activation-config-property>

                                              </activation-config>

                               </message-driven>

                </enterprise-beans>

      </ejb-jar>

       

      with these changes when I start my server I get the following error:

       

      10:33:43,177 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.deployment.unit."JBossQueueReader.jar".component.QueueReader.START: org.jboss.msc.service.StartException in service jboss.deployment.unit."JBossQueueReader.jar".component.QueueReader.START: Failed to start service

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_32]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_32]

                at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_32]

      Caused by: java.lang.RuntimeException: javax.resource.spi.InvalidPropertyException: Destination is mandatory

                at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.start(MessageDrivenComponent.java:171)

                at org.jboss.as.ee.component.ComponentStartService.start(ComponentStartService.java:44)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                ... 3 more

      Caused by: javax.resource.spi.InvalidPropertyException: Destination is mandatory

                at org.hornetq.ra.inflow.HornetQActivationSpec.validate(HornetQActivationSpec.java:643)

                at org.jboss.jca.core.rar.EndpointImpl.activate(EndpointImpl.java:157)

                at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.start(MessageDrivenComponent.java:169)

                ... 6 more

       

       

      10:33:43,200 INFO  [org.jboss.as] (MSC service thread 1-6) JBAS015951: Admin console listening on http://127.0.0.1:9990

      10:33:43,202 ERROR [org.jboss.as] (MSC service thread 1-6) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 4759ms - Started 250 of 334 services (1 services failed or missing dependencies, 82 services are passive or on-demand)

      10:33:43,207 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "JBossQueueReader.jar" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"JBossQueueReader.jar\".component.QueueReader.START" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"JBossQueueReader.jar\".component.QueueReader.START: Failed to start service"}}

      10:33:43,213 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015871: Deploy of deployment "jboss-as-helloworld.jar" was rolled back with no failure message

      10:33:43,254 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment jboss-as-helloworld.jar in 39ms

      10:33:43,449 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment JBossQueueReader.jar in 237ms

      10:33:43,451 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

      JBAS014777:   Services which failed to start:      service jboss.deployment.unit."JBossQueueReader.jar".component.QueueReader.START: org.jboss.msc.service.StartException in service jboss.deployment.unit."JBossQueueReader.jar".component.QueueReader.START: Failed to start service

       

       

      10:33:43,457 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS014654: Composite operation was rolled back

      10:33:43,461 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"JBossQueueReader.jar\".component.QueueReader.START" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"JBossQueueReader.jar\".component.QueueReader.START: Failed to start service"}}}}

       

      Is there any other step to performed in order to have my application working anyway??

      I need to separate configuration from classes.

       

      Thanks

      Laura

       

      Note: full JBoss trace is attached.

        • 1. Re: MDB Deployment using Eclipse with AS7.1
          Max Rydahl Andersen Master

          Better asking this in JBoss user forum since as I read it its not a tooling question, but more a configuration/deployment of the MDB's you are looking for ?

           

          When you do raise that question do outline how your deployment is layed out (i.e. archive names) since "deployed with Tools" doesn't say much about that

          • 3. Re: MDB Deployment using Eclipse with AS7.1
            jaikiran pai Master

            Your EJB name in the deployment descriptor (ejb-jar.xml) and the annotated bean implementation class is not matching:

            @MessageDriven

            public class QueueReader implements MessageListener


            <ejb-name>JBossQueueReader</ejb-name>

            That's the reason, the activation config properties and other elements aren't being applied to the QueueReader bean. Either fix the ejb-name element in the ejb-jar.xml or use the "name" attribute available on the @MessageDriven annotation to match the deployment descriptor and the annotation.

            • 4. Re: MDB Deployment using Eclipse with AS7.1
              Mayank Gupta Newbie

              If you are not using EJB3.0 or above you cannot use the annotation.

              In that case also I am facing the same problem while deploying my MDB.

               

              I have resolved it by adding the following ActivationConfigProperty in ejb-jar.xml of MDB

              <activation-config-property>

                                                         <activation-config-property-name>destination</activation-config-property-name>

                                                         <activation-config-property-value><Input Actual JNDI binding name></activation-config-property-value>

                                                       </activation-config-property>