5 Replies Latest reply on Dec 14, 2011 9:28 AM by mreynolds0404

    EJB Jar Does Not Deploy in JBoss AS 6

    mreynolds0404

      I have an application I am trying to get running in JBoss 6.  It is packaged as an ear that contains a war and an ejb-jar.  The ejb-jar contains a handful of EJB3 style (annotations) mdb's with no xml deployment descriptor file.  When I deploy the application to JBoss, the war deploys fine but the ejb-jar does not.  I see no errors in the log or even any logging indicating that JBoss sees the ejb-jar.

       

      I noticed in JBoss' Admin Console that the topic for the mdb's was not being created, so I added a hornetq-ms.xml file to the ear to autocreate the topic.  That seems to have worked but doesn't help with the ejb issue.

       

      Additionally, we use a jboss-structure.xml file to force some classpath ordering.

       

      Here is the application.xml file from the ear:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE application PUBLIC
          "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
          "http://java.sun.com/dtd/application_1_3.dtd">
      <application>
        <display-name>admin-ear</display-name>
        <description></description>
        <module>
          <web>
            <web-uri>admin-5.0.0-SNAPSHOT.war</web-uri>
            <context-root>/admin</context-root>
          </web>
        </module>
        <module>
          <ejb>admin-ejbs-5.0.0-SNAPSHOT.jar</ejb>
        </module>
      </application>
      

       

      Here is the jboss-structure.xml file:

      <structure>
        <context>
          <path name="" />
          <metaDataPath>
            <path name="META-INF" />
          </metaDataPath>
          <classpath>
            <path name="./lib/10-admin-classes-5.0.0-SNAPSHOT.jar"/>
            <path name="./lib/10-bootstrap-5.0.0-SNAPSHOT.jar"/>
            <path name="./lib/10-prepared-statement-patch-5.0.0-SNAPSHOT.jar"/>
            <path name="./lib" suffixes=".jar"/>
          </classpath>
        </context>
        <context>
          <path name="admin-5.0.0-SNAPSHOT.war" />
          <classpath>
            <path name="admin-5.0.0-SNAPSHOT.war/WEB-INF/lib" suffixes=".jar"/>
          </classpath>
          <metaDataPath>
            <path name="WEB-INF" />
          </metaDataPath>
        </context>
      </structure>
      
        • 1. Re: EJB Jar Does Not Deploy in JBoss AS 6
          wdfink

          How the structure of EAR and ejb-jaris?

          What if you try deploy the ear only with the ejb-jar?

           

          If you see no errors during deploy it sounds to me that the ejb-jar is not detected or there is nothing in it.

          • 2. Re: EJB Jar Does Not Deploy in JBoss AS 6
            mreynolds0404

            Here is the structure of the ear:

             

            -admin.ear
                 - lib
                      - various dependency jars
                 - META-INF
                      - application.xml
                      - jboss-app.xml
                      - jboss-structure.xml
                      - MANIFEST.MF
                 - admin-ejbs.jar
                      - META-INF
                           - MANIFEST.MF
                      - com
                           - company
                                - admin
                                     - EventLogConsumerMDB.class
                                     - OfflineEventConsumerMDB.class
                                     - DataLoadEventConsumerMDB.class
                 - admin.war
                      - typical war contents
            

             

            I tried pulling the war out of the ear with no effect other than the war not deploying (obviously).  The ejb-jar is certainly not empty so there must be a lack of detection on JBoss' part, although I can not figure out what is abnormal about this ear that is causing that.

            • 3. Re: EJB Jar Does Not Deploy in JBoss AS 6
              mreynolds0404

              I realize there may not be much to go on here to address my problem.  Would anyone know where in the JBoss code would be a good place to debug the detection and deployment of ejb-jars?  Thanks.

              • 4. Re: EJB Jar Does Not Deploy in JBoss AS 6
                jaikiran

                Why do you have the jboss-structure.xml? Try removing it and see if it picks up the EJB deployment. If that doesn't then enable TRACE level logs for org.jboss.ejb3 package and see what it shows in the server.log for your EJB deployments. Also, can you post the relevant code from your MDBs which show the annotations?

                • 5. Re: EJB Jar Does Not Deploy in JBoss AS 6
                  mreynolds0404

                  We are using jboss-structure.xml to enforce classpath ordering which is a necessary legacy requirment of the application.

                   

                   

                  Here are the MDB annotations:

                   

                   

                   


                   

                  @MessageDriven(name = "EventLogConsumerMDB", activationConfig = {
                      @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
                      @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
                      @ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/com.xst.dao.ctl.IEventLogEntry"),
                      @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "loggerCategory NOT LIKE 'com.store.dataloader.download_id=configurator::%' "
                          + "AND loggerCategory NOT LIKE 'com.store.dataloader.download_id=dataload::%' "
                          + "AND loggerCategory NOT LIKE 'com.sysadmin.data.failover%'"),
                      @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),
                      @ActivationConfigProperty(propertyName = "clientId", propertyValue = "EventLogConsumerMDB"),
                      @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "StoreEventLogs") }, messageListenerInterface = MessageListener.class)
                  public class EventLogConsumerMDB implements MessageDrivenBean, MessageListener {}
                  
                  @MessageDriven(name = "DataloadEventLogConsumerMDB", activationConfig = {
                      @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
                      @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
                      @ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/com.xst.dao.ctl.IEventLogEntry"),
                      @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "loggerCategory LIKE 'com.store.dataloader.download_id=dataload::%'"),
                      @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),
                      @ActivationConfigProperty(propertyName = "clientId", propertyValue = "DataloadEventLogConsumerMDB"),
                      @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "StoreDataloadEventLogs")}, messageListenerInterface = MessageListener.class)
                  public class DataloadEventLogConsumerMDB
                      extends EventLogConsumerMDB{}
                  
                  @MessageDriven(name = "CfgEventLogConsumerMDB", activationConfig = {
                      @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
                      @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
                      @ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/com.xst.dao.ctl.IEventLogEntry"),
                      @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "loggerCategory LIKE 'com.store.dataloader.download_id=configurator::%'"),
                      @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),
                      @ActivationConfigProperty(propertyName = "clientId", propertyValue = "CfgEventLogConsumerMDB"),
                      @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "ConfiguratorEventLogs") }, messageListenerInterface = MessageListener.class)
                  public class CfgEventLogConsumerMDB extends EventLogConsumerMDB {}
                  
                  @MessageDriven(name = "OfflineEventLogConsumerMDB", activationConfig = {
                      @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
                      @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
                      @ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/com.xst.dao.ctl.IEventLogEntry"),
                      @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "loggerCategory LIKE 'com.sysadmin.data.failover%'"),
                      @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),
                      @ActivationConfigProperty(propertyName = "clientId", propertyValue = "OfflineEventLogConsumerMDB"),
                      @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "StoreOfflineEventLogs")}, messageListenerInterface = MessageListener.class)
                  public class OfflineEventLogConsumerMDB
                      extends EventLogConsumerMDB {}
                  
                  

                   

                  I'll try the logging as well and see if there if JBoss reports anything regarding the ejb-jar.