1 Reply Latest reply on May 18, 2017 9:10 AM by Justin Bertram

    Mapping mdb in Jboss 6.4 EAP

    Naveen Poddar Newbie

      I am migrating my enterprise application from Jboss 4.3 AS  to 6.4 EAP. Now facing issue while mapping one mdb. The old mapping of the mdb in

       

      ejb-jar.xml

            <message-driven id="MessageDriven_1">

               <description><![CDATA[Works on messages in the Process Queue]]></description>

               <ejb-name>MessageBll</ejb-name>

               <ejb-class>com.adminserver.bll.MessageBllBean</ejb-class>

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

               <acknowledge-mode>Auto-acknowledge</acknowledge-mode>

               <message-driven-destination>

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

               </message-driven-destination>

               <ejb-local-ref id="EJBLocalRef_174">

                  <ejb-ref-name>ScheduledValuationBll</ejb-ref-name>

                  <ejb-ref-type>Session</ejb-ref-type>

                  <local-home>com.adminserver.bll.ScheduledValuationBllHome</local-home>

                  <local>com.adminserver.bll.ScheduledValuationBll</local>

                  <ejb-link>ScheduledValuationBll</ejb-link>

               </ejb-local-ref>

               <resource-ref id="ResRef_107">

                  <res-ref-name>jms/AdminServerConnectionFactory</res-ref-name>

                  <res-type>javax.jms.ConnectionFactory</res-type>

                  <res-auth>Container</res-auth>

                  <res-sharing-scope>Shareable</res-sharing-scope>

               </resource-ref>

            </message-driven>

       

      jboss.xml

            <message-driven>

               <ejb-name>MessageBll</ejb-name>

               <destination-jndi-name>jms/ScheduledValuationQueue</destination-jndi-name>

                  <resource-ref>

                       <res-ref-name>jms/AdminServerConnectionFactory</res-ref-name>

                       <jndi-name>jms/AdminServerConnectionFactory</jndi-name>

                 </resource-ref>

            </message-driven>

       

      Now I need corressponding entries for newer jboss-ejb3.xml and ejb-jar.xml that will de deployed in Jboss 6.4 EAP

       

      Currently this is what my jboss-ejb3.xml looks like which does not works

       

          <message-driven>

               <ejb-name>MessageBll</ejb-name>

        <resource-ref>

        <res-ref-name>jms/RemoteConnectionFactory</res-ref-name>

        <jndi-name>java:jms/queue/ScheduledValuationQueue</jndi-name>

        </resource-ref>

           </message-driven>

       

      I have added the above queue entry in standalone-full.xml

        • 1. Re: Mapping mdb in Jboss 6.4 EAP
          Justin Bertram Master

          It looks like your message may have been cut off.  I don't understand what the actual problem is.  You say it "doesn't work" but you don't provide any detail about what exactly doesn't work.  Are there any error messages?  Does the MDB fail to deploy?  Is it not able to reference the configured resource(s)?

           

          This looks weird:

           

            <resource-ref>

            <res-ref-name>jms/RemoteConnectionFactory</res-ref-name>

            <jndi-name>java:jms/queue/ScheduledValuationQueue</jndi-name>

            </resource-ref>

           

          You have a resource which you've named (via res-ref-name) as a connection factory, but the corresponding JNDI name is for a queue.

           

          Also, local resources shouldn't use RemoteConnectionFactory as that will go through an unnecessary remoting layer and impose a performance penalty.  Typically local resources would want to use a <pooled-connection-factory> like JmsXA.