Inter-war dependencies: Excluding parts of it
mazi Sep 13, 2011 1:36 PMHi,
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