5 Replies Latest reply on Dec 24, 2011 7:13 AM by Guillaume Grossetie

    Bug in war deployment dependency resolution?

    jamesbaxter Newbie

      Hello,

       

      I have a Filter defined in a EJB jar which is referenced in a Wars' web.xml. Both components are deployed within an Ear file. During deployment I get the exception:

       

      09:24:46,328 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.subunit."my.ear"."my.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."my.ear"."my.war".INSTALL: Failed to process phase INSTALL of subdeployment "my.war" of deployment "my.ear"
                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
                at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
                at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
      Caused by: java.lang.IllegalArgumentException: name is null
                at org.jboss.msc.service.ServiceBuilderImpl.doAddDependency(ServiceBuilderImpl.java:203)
                at org.jboss.msc.service.ServiceBuilderImpl.addDependency(ServiceBuilderImpl.java:197)
                at org.jboss.msc.service.ServiceBuilderImpl.addDependency(ServiceBuilderImpl.java:191)
                at org.jboss.as.ejb3.deployment.processors.EjbInjectionSource.getResourceValue(EjbInjectionSource.java:70)
                at org.jboss.as.ee.component.ModuleJndiBindingProcessor.addJndiBinding(ModuleJndiBindingProcessor.java:189)
                at org.jboss.as.ee.component.ModuleJndiBindingProcessor$1.handle(ModuleJndiBindingProcessor.java:157)
                at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:52)
                at org.jboss.as.ee.component.ModuleJndiBindingProcessor.processClassConfigurations(ModuleJndiBindingProcessor.java:129)
                at org.jboss.as.ee.component.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:122)
                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
                ... 5 more
      
      

       

      I've been struggling to get my head around this, but from looking at DeploymentUnitPhaseService and below, it looks like the Filter is marked for injection using an EjbInjectionSource but the resolve method is not called as it is not directly added as a dependency of the War module.

       

      Sometimes it works as the EjbInjectionSource seems to be stored at the EEApplicationDescription level and can be processed by another deployment unit (dependent on timing).

       

      I'm not sure if this is a bug in the dependency resolution process or if I'm violating a spec? It is quite handy to define a Filter in a common module and reuse it across Wars...

       

      Any advice is appreciated.

        • 1. Re: Bug in war deployment dependency resolution?
          jaikiran pai Master

          This might be related to https://issues.jboss.org/browse/AS7-1675 which just got fixed recently. Can you try this against the latest nightly build from today?

          • 2. Re: Bug in war deployment dependency resolution?
            jamesbaxter Newbie

            Thanks I'll follow the instructions here and see how I get on: http://community.jboss.org/wiki/HackingOnAS7

             

            Handy co-incidence that bug was fixed today

            • 3. Re: Bug in war deployment dependency resolution?
              jamesbaxter Newbie

              Sadly not fixed...

               

              12:37:50,797 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.subunit."my.ear"."my.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."my.ear"."my.war".INSTALL: Failed to process phase INSTALL of subdeployment "my.war" of deployment "my.ear"
                        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.1.0.Alpha1-SNAPSHOT.jar:7.1.0.Alpha1-SNAPSHOT]
                        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
                        at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
              Caused by: java.lang.IllegalArgumentException: name is null
                        at org.jboss.msc.service.ServiceBuilderImpl.doAddDependency(ServiceBuilderImpl.java:203) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                        at org.jboss.msc.service.ServiceBuilderImpl.addDependency(ServiceBuilderImpl.java:197) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                        at org.jboss.msc.service.ServiceBuilderImpl.addDependency(ServiceBuilderImpl.java:191) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                        at org.jboss.as.ejb3.deployment.processors.EjbInjectionSource.getResourceValue(EjbInjectionSource.java:70)
                        at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.addJndiBinding(ModuleJndiBindingProcessor.java:200)
                        at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor$1.handle(ModuleJndiBindingProcessor.java:168)
                        at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:52)
                        at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.processClassConfigurations(ModuleJndiBindingProcessor.java:140)
                        at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:133)
                        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.1.0.Alpha1-SNAPSHOT.jar:7.1.0.Alpha1-SNAPSHOT]
                        ... 5 more
              
              
              • 4. Re: Bug in war deployment dependency resolution?
                jaikiran pai Master

                Can you please attach a sample application which reproduces this?

                • 5. Re: Bug in war deployment dependency resolution?
                  Guillaume Grossetie Newbie

                  Hello James,

                   

                  Did you find a workaround ? I'm stuck with the same error.

                  My ear contains both war and jar files. I setted the ear-subdeployments-isolated element value to "false" (just to be sure) :

                   

                  By default this is set to false, which allows the sub-deployments to see classes belonging to other sub-deployments within the .ear.

                   

                   

                  The classloading documentation is not clear on this point :

                  https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7

                  For example, consider the following .ear deployment:

                  myapp.ear

                  |--- web.war
                  |--- ejb1.war
                  |--- ejb2.war

                  If the ear-subdeployments-isolated is set to false, then the classes in web.war can access classes belonging to ejb1.jar and ejb2.jar.

                   

                  And just below :

                  The ear-subdeployments-isolated element value has no effect on the isolated classloader of the .war file(s). i.e. irrespective of whether this flag is set to true or false, the .war within a .ear will have a isolated classloader and other sub-deployments within that .ear will not be able to access classes from that .war. This is as per spec.

                   

                  I don't understand if the ear-subdeployments-isolated flag setted to "false" will allow the war file to access classes from jar (and vice-versa) ?

                   

                  I can confirm that the deployment fails depending on timing... so it's quite hard to attach a sample application which reproduces this. I started to fill the jboss-deployment-structure.xml file to explicit my dependencies but without success.

                   

                   

                  Guillaume.