Y
Y
Yuri Vitkovsky2015-07-01 12:39:49
Java
Yuri Vitkovsky, 2015-07-01 12:39:49

JBoss/Wildfly restarting dependent EARs?

Good afternoon.
Tell me how to force the dependent EAR to restart correctly when the main one is restarted (redeploy)?
For example:
There are 2 EAR modules:

module1.ear
|
+--META-INF
|  |
|  +--jboss-deployment-structure.xml
|
+--ejb.jar
   |
   +--persistence.xml with persistence unit "module1-pu"

and
module2.ear
|
+--META-INF
|  |
|  +--jboss-deployment-structure.xml
|
+--ejb.jar
   |
   +--persistence.xml with persistence unit "module2-pu"

module1.ear/META-INF/jboss-deployment-structure.xml contains the following:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
    <ear-subdeployments-isolated>false</ear-subdeployments-isolated>
    <deployment>
        <module-alias name="deployment.module1"/>
    </deployment>
</jboss-deployment-structure>

module2.ear/META-INF/jboss-deployment-structure.xml contains the following:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
    <ear-subdeployments-isolated>false</ear-subdeployments-isolated>
    <deployment>
        <module-alias name="deployment.module2"/>
        <dependencies>
            <module name="deployment.module1.ear" export="true">
            </module>
        </dependencies>
    </deployment>
</jboss-deployment-structure>

When redeploying module1, the second module fails to start, failing with the error "JBAS014666: Duplicate resource module2.ear/ejb.jar#module2-pu". Although the log shows how this Persistence Unit was unloaded.
Here is the full log of the process of restarting the module pastebin.com/u4ykXLn0
UDP1: Dependent WARs and EARs without Persistence Unit restart normally, the problem seems to be in the Persistence Unit. Tried on Wildfly 8.2.0.Final and Wildfly 9.0.0.CR2

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question