Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-9555

CDI fails in multiple war inside ear - depends on war name

    Details

    • Steps to Reproduce:
      Hide

      The project build files are attached.
      Have two wars with a Servlet injecting a regular POJO from the same war (HelloWorldServlet injecting HelloWorld class)
      Deploy the ear that contains hello.war and goodbye.war.
      The log shows that only one bean is injected - only HelloWorld is injected and Goodbye is null.
      Now rename (or rebuild the ear with one war name changed) one of the war so that it is in different sorted order. (say hello.war to ahello.war or goodbye.war zgoodbye.war). When redeployed, now the HelloWorld is null and Goodbye is injected.

      The project structure is as follows.
      The maven source to build the project is attached.

      hello_EAR.ear
      +META-INF
      application.xml
      +hello.war
      +WEB-INF
      classes
      com.hello.HelloWorldServlet.class
      com.hello.HelloWorld.class
      web.xml
      beans.xml
      META-INF
      +goodbye.war
      +WEB-INF
      classes
      com.hello.GoodbyeWorldServlet.class
      com.hello.GoodbyeWorld.class
      web.xml
      beans.xml
      +META-INF

      Show
      The project build files are attached. Have two wars with a Servlet injecting a regular POJO from the same war (HelloWorldServlet injecting HelloWorld class) Deploy the ear that contains hello.war and goodbye.war. The log shows that only one bean is injected - only HelloWorld is injected and Goodbye is null. Now rename (or rebuild the ear with one war name changed) one of the war so that it is in different sorted order. (say hello.war to ahello.war or goodbye.war zgoodbye.war). When redeployed, now the HelloWorld is null and Goodbye is injected. The project structure is as follows. The maven source to build the project is attached. hello_EAR.ear +META-INF application.xml +hello.war +WEB-INF classes com.hello.HelloWorldServlet.class com.hello.HelloWorld.class web.xml beans.xml META-INF +goodbye.war +WEB-INF classes com.hello.GoodbyeWorldServlet.class com.hello.GoodbyeWorld.class web.xml beans.xml +META-INF

      Description

      CDI injection fails (is null) in a war when the ear contains more than one war file. The CDI succeeds/fails based on which war gets deployed first. If the any of the failed war is deployed alone, it succeeds.
      This issue does not happen in jboss AS 7 or EAP 6

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                marius.bogoevici Marius Bogoevici
                Reporter:
                pugals pugal srini
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: