1 Reply Latest reply on Jul 30, 2007 1:23 PM by tnine

    EAR does not correctly deploy EJB3 MDB

    tnine

      Hi all,
      I have an ear with an MDB that connects to a spring POJO. The deployment is very simple and the ear deploys correctly, however the MDB never reads from the queue, nor can I see my scoped classloader, or the EJB in the JMX console. I'm using JBoss 4.0.2, and an EJB3 MDB. I have included my configuration. The ear does contain all of the neccessary files (I think), and I'm not sure what's going on. Here are my configuration files.

      In the ear

      application.xml

      <application>
       <display-name>ear</display-name>
       <description>statementear</description>
       <module>
       <ejb>mdb-1.0.0-SNAPSHOT.jar</ejb>
       </module>
      </application>
      


      jboss-app.xml
      <jboss-app>
       <loader-repository>statements.purdueefcu.com:loader=ear-1.0.0-SNAPSHOT</loader-repository>
      </jboss-app>
      


      MDB class
      /**
       * @author Todd Nine
       *
       */
      @MessageDriven(activationConfig =
      {
      @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
      @ActivationConfigProperty(propertyName="destination", propertyValue="queue/StatementInput")
      })
      public class StatementMessageDrivenBean extends AbstractJmsMessageDrivenBean {
      ..
      /*
       * (non-Javadoc)
       *
       * @see javax.jms.MessageListener#onMessage(javax.jms.Message)
       */
       public void onMessage(Message message) {...}
      }
      


      I know the queue is set up correctly, I'm able to push messaged onto it, and they are correctly persisted. This is a high availability JBoss MQ installation, do I need to set any special properties in my annotations to read from it?

        • 1. Re: EAR does not correctly deploy EJB3 MDB
          tnine

          Just for a follow up, it does work with my 2.0 descriptions. Am I missing something with my 3.0 annotations?

          ejb-jar.xml

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
          "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
          <ejb-jar>
           <description>Message Driven Bean</description>
           <display-name>Statements Message Driven Bean</display-name>
          
           <!--Define our EJBs-->
           <enterprise-beans>
           <!-- Define our MDB for statements-->
           <message-driven>
           <description>
           Bean to access messages statement input queue
           </description>
           <display-name>Statement Bean</display-name>
          
           <ejb-name>ejb/StatementBean</ejb-name>
          
           <ejb-class>
           com.purdueefcu.statements.mdb.StatementMessageDrivenBean
           </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>
           <resource-ref>
           <res-ref-name>statmentinput</res-ref-name>
           <res-type>javax.jms.QueueConnectionFactory</res-type>
           <res-auth>Container</res-auth>
           </resource-ref>
          
          
           </message-driven>
           </enterprise-beans>
          
           <!-- make our EJB an XA transaction -->
           <assembly-descriptor>
           <container-transaction>
           <method>
           <ejb-name>ejb/StatementBean</ejb-name>
           <method-name>*</method-name>
           </method>
           <trans-attribute>Required</trans-attribute>
           </container-transaction>
           </assembly-descriptor>
          </ejb-jar>
          
          


          jboss.xml
          <?xml version='1.0' encoding='UTF-8' ?>
          <!DOCTYPE jboss PUBLIC
           "-//JBoss//DTD JBOSS 4.0//EN"
           "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
          
          <jboss>
           <enterprise-beans>
           <message-driven>
           <ejb-name>ejb/StatementBean</ejb-name>
           <destination-jndi-name>queue/StatementInput</destination-jndi-name>
           <resource-ref>
           <res-ref-name>statmentinput</res-ref-name>
           <jndi-name>ConnectionFactory</jndi-name>
           </resource-ref>
           </message-driven>
           </enterprise-beans>
          </jboss>