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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 6.1.0
    • Weld/CDI
    • 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

      Attachments

        Activity

          People

            marius.bogoevici Marius Bogoevici (Inactive)
            pugals pugal srini (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: