Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-2505

Deployment order for MDBs and RAs is not working for a packaged EAR

    Details

    • Steps to Reproduce:
      Hide

      Steps to reproduce:

      • Drop in the EAR attached, and the application will fail to load with an error:
        java.lang.IllegalStateException: Cannot find any resource adapter service for resource adapter connector

      Verify the fix:
      If the application loads without any error, one can access http://host:port/web, which should display "Web Module Loaded!", guaranteeing that the MDB and the RA were loaded in the expected order (i.e., first the RA and then the MDB).

      Details on the attached application

      • EAR contains 1 web module, 1 resource adapter (RA), and 1 MDB that depends on the RA to be loaded first.
      • application.xml defines the order in which these modules must be loaded. I have added comments and toggles to enable the aforementioned different ways to specify the deployment order.
      • I have attached all the source code, including that of RA, MDB and web app. The code is very simple and straight-ward to understand; however, please let me know if you need more info.
      Show
      Steps to reproduce: Drop in the EAR attached, and the application will fail to load with an error: java.lang.IllegalStateException: Cannot find any resource adapter service for resource adapter connector Verify the fix: If the application loads without any error, one can access http://host:port/web , which should display "Web Module Loaded!", guaranteeing that the MDB and the RA were loaded in the expected order (i.e., first the RA and then the MDB). Details on the attached application EAR contains 1 web module, 1 resource adapter (RA), and 1 MDB that depends on the RA to be loaded first. application.xml defines the order in which these modules must be loaded. I have added comments and toggles to enable the aforementioned different ways to specify the deployment order. I have attached all the source code, including that of RA, MDB and web app. The code is very simple and straight-ward to understand; however, please let me know if you need more info.
    • Workaround Description:
      Hide

      No workaround. Application just fails to deploy.

      Show
      No workaround. Application just fails to deploy.

      Description

      If an application is packaged with MDBs and RAs (resource adapters) such that the order of deployment of these modules needs to be deterministic, the application fails to load. In other words, there is no way to define the order in which MDBs and RAs must be loaded in an application. This is a strict requirement by JEE 6, and without this support, JBoss 7 cannot be fully JEE 6 compliant.

      Theoretically, following are 3 different ways to accomplish the above objective:

      1. Set <initialize-in-order> to true; see http://java.sun.com/xml/ns/javaee/application_6.xsd. This seems to be fixed in AS7-325, but I tested it using a sample application, and this definitely does not work for MDBs and RAs.
      2. Add jboss-ejb3.xml in the MDB jar's MATA-INF to define the MDB's dependency on an RA. Adding this configuration MUST ensure that the application loader loads the RA before trying to load the MDB. Development of this feature is still in progress (AS7-1211).
      3. Add org.jboss.ejb3.annotation.Depends annotation on the MDB implementation, to do the same as #2.

      None of the above work in the nightly build of AS7.1.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jaikiran Jaikiran Pai
                Reporter:
                abhis Abhi S
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: