2 Replies Latest reply on Sep 16, 2011 7:11 AM by mazi

    Inter-war dependencies: Excluding parts of it

    mazi

      Hi,

       

      I have two war deployments and I would like the second one (admin.war) to use some (but not all) classes from the first one (ppay-web.war). I tried to achieve this using jboss-deployment-structure.xml, as in the example at the end of this page:

       

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

       

      I've tried lots of stuf with different <include>s and <excludes> but I can't get them to do anything. For example, when using the following config (or anything similar), still everything from ppay-web.war is visible in admin.war:

       

      <jboss-deployment-structure>

          <deployment>

              <dependencies>

                  ...

                  <module name="deployment.com.profpay.data"/>

              </dependencies>

          </deployment>

          <module name="deployment.com.profpay.data" >

              <exports>

                  <exclude path="/**"/>

              </exports>

              <dependencies>

                  <module name="deployment.ppay-web.war" export="true" >

                      <imports>

                          <include path="qqq" />

                          <exclude path="/**" />

                      </imports>

                      <exports>

                          <exclude path="/**"/>

                      </exports>

                  </module>

              </dependencies>

          </module>

      </jboss-deployment-structure>

       


      (Note that this is just an example, my final goal is not to exclude EVERYTHING, of course, but just parts.)

       

      Setting export="false" does exclude everything, though. (But as I said, this is not what I want.)

       

      The above example defines a new module named "deployment.com.profpay.data"; I've also tried without defining a new module, like this, with similar results:

       

          <deployment>

              <dependencies>

                  ...

                  <module name="deployment.ppay-web.war">

                      <imports>

                          <exclude path="/**"/>

                          <include path="com/profpay/data/**"/>

                      </imports>

                  </module>

              </dependencies>

          </deployment>

       

      So, what is the right way to use just parts of a war in anoter war as dependencies?

       

      -----------------------------

       

      BTW, if I use the whole ppay-web.war in admin.war as dependency, i get the error below. I don't understand this error but I know it can be avoided by correctly excluding what I don't need from ppay-web.war: If I manually strip ppay-web.war down to just what I need in admin.war, admin works fine (but then ppay-web of course doesn't).

       

      16:09:38,679 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."admin-2.0.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."admin-2.0.war".INSTALL: Failed to process phase INSTALL of deployment "admin-2.0.war"

                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_24]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]

                at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: No method found with id: Method afterTransactionCompletion(boolean) on class (or its super class) class org.jboss.seam.transaction.EjbSynchronizations

                at org.jboss.as.server.deployment.reflect.ClassReflectionIndexUtil.findRequiredMethod(ClassReflectionIndexUtil.java:82) [jboss-as-server-7.1.0.Alpha1-SNAPSHOT.jar:7.1.0.Alpha1-SNAPSHOT]

                at org.jboss.as.server.deployment.reflect.ClassReflectionIndexUtil.findRequiredMethod(ClassReflectionIndexUtil.java:107) [jboss-as-server-7.1.0.Alpha1-SNAPSHOT.jar:7.1.0.Alpha1-SNAPSHOT]

                at org.jboss.as.ee.component.ViewDescription$DefaultConfigurator.configure(ViewDescription.java:158)

                at org.jboss.as.ee.component.ComponentDescription$DefaultFirstConfigurator.configure(ComponentDescription.java:879)

                at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:72)

                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

       

        • 1. Re: Inter-war dependencies: Excluding parts of it
          mazi

          Ok, I think I've figured this one out. To exclude the class test.excluded.Excluded, I could use any one of these:

           

                              <exclude path="test/excluded**"/>

                              <exclude path="test/excluded*"/>

                              <exclude path="test/excluded"/>

                              <exclude path="test/excl*"/>

           

          while neither of these did the trick:

           

                              <exclude path="test/excluded/**"/>

                              <exclude path="test/excluded/*"/>

           

          Funny, because the last two seemed to me the most logical of all...

           

          I think this will help me solve the above problem, but this wildcard syntax still seems a bit weird to me. Is it explained anywhere? (Or is it just common knowledge from some other domain (eg. Linux) which I know nothing about?)

           

          BTW, to exclude everything, this worked for me:

                              <exclude path="**"/>

          and this (taken from the docs) didn't:

                              <exclude path="/**"/>

          1 of 1 people found this helpful
          • 2. Re: Inter-war dependencies: Excluding parts of it
            mazi

            There's more. To include just the stuff from package test.included I did this:

             

                                <include path="test/included*"/>

                                <exclude path="**"/>

             

            While this (just reverse order) did't work (the effect was that everything was excluded):

             

                                <exclude path="**"/>

                                <include path="test/included*"/>

             

            So this got got me both 1) a bit closer to the solution of my problem, and 2) a bit more confused.