1 Reply Latest reply on Aug 4, 2016 5:20 AM by jaikiran pai

    Migrated ejb 2.x MDB failed to deploy due to Missing destination. How to fix?

    milspec Newbie

      Hi all,

       

      Another migration-from-old-jboss to question. I've searched docs , forum posts, etc and tried a few things, but have not gotten past this issue.

       

      Any suggestions?

       

      thanks in advance.

       

       

      Problem: Message Driven Beans (MDB) fail to deploy due to missing 'destination'

      MDB fails to deploy due to a mis-configuration. Here's the line from server.log

       

      2016-08-02 23:31:10,980 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 65) MSC000001: Failed to start service jboss.deployment.subunit."app.ear"."app-ejb.jar".component.AsynchronousSchedulerService.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."app.ear"."app-ejb.jar".component.AsynchronousSchedulerService.START: java.lang.RuntimeException: javax.resource.spi.InvalidPropertyException: Invalid settings: Destination is mandatory.

       

       

      Details

      • ejb 2.x app
      • MDB uses "xml-configuration" , not annotation
      • Old jboss.xml had this:

            <message-driven>

               <ejb-name>AsynchronousSchedulerService</ejb-name>

               <destination-jndi-name>topic/schedulerTopic</destination-jndi-name>

            </message-driven>

      • I tried adding 'mapped-name' to ejb-jar.xml but got the same error

                     <mapped-name>topic/schedulerTopic</mapped-name>

      • I've created an jboss-ejb3.xml and fired it up in an xml editor (with schema validation). The schema forbids me from adding either of these elements:

            <jndi-name/>

            <destination-jndi-name/>     

      • However, in the  jboss-ejb-3-2_0.xsd schema file I do see this. I don't know what to make of it

            <xs:element name="destination-jndi-name" type="xs:string" />          

      • Here is a fragment of my jboss-ejb3.xml file:

       

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

      <ejb-jar       xmlns:jboss="http://www.jboss.com/xml/ns/javaee"

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

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

                     xmlns:s="urn:security:1.1"

                     xmlns:jboss_ejb="http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd"

                     xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd 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>AsynchronousSchedulerService</ejb-name>

             <!--

                   <jndi-name>topic/schedulerTopic</jndi-name>

                 -->

                  <ejb-class>com.acme.app.scheduler.service.ejb.AsynchronousSchedulerServiceEJB</ejb-class>

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

                  <message-selector>

                     <![CDATA[JMSType='schedulerTask']]>

                  </message-selector>

                  <message-driven-destination>

                     <destination-type>javax.jms.Topic</destination-type>

                     <subscription-durability>NonDurable</subscription-durability>

                  </message-driven-destination>

       

               </message-driven>

      ...

      </ejb-jar>

        • 1. Re: Migrated ejb 2.x MDB failed to deploy due to Missing destination. How to fix?
          jaikiran pai Master

          Here's an example of how to set it up wildfly/jboss-ejb3.xml at master · wildfly/wildfly · GitHub. That example is from the WildFly testsuite so is expected to work.

           

          <?xml version="1.0" encoding="UTF-8"?>
          
          <jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
            xmlns="http://java.sun.com/xml/ns/javaee"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd
            http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
            version="3.1"
            impl-version="2.0">
            <enterprise-beans>
          <message-driven>
          <ejb-name>ReplyingMDB</ejb-name>
          
          <activation-config>
          <activation-config-property>
          <activation-config-property-name>destination</activation-config-property-name>
          <activation-config-property-value>java:jboss/mdbtest/messageDestinationQueue</activation-config-property-value>
          </activation-config-property>
          </activation-config>
          </message-driven>
            </enterprise-beans>
          </jboss:ejb-jar>