I am using JBoss EAP 7.1 in Domain mode.
I have setup my static modules in eap_home/modules
folder:
com
|- organization
|- global
|- main (this has module.xml)
I have a myservice.ear
that I want to deploy.
Put the ear inside standalone/deployment/
and start the server using ./standalone.sh
: works fine.
Deploy using jboss-cli
: fails
deploy /<PATH>/myservice.ear --name=myservice --runtime-name=myservice.ear --server-groups=main-server-group
I get following error message:
[.... /] deploy /<PATH>/myservice.ear --name=myservice --runtime-name=myservice.ear --server-groups=main-server-group
{"WFLYDC0074: Operation failed or was rolled back on all servers. Server failures:" => {"server-group" => {"main-server-group" => {"host" => {"slave1" => {"server-one" => {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.services.ear.service-one-SNAPSHOT.war\".main" => "WFLYSRV0179: Failed to load module: deployment.services.ear.service-one-SNAPSHOT.war
Caused by: org.jboss.modules.ModuleNotFoundException: com.organization.global",.......<few more statements with the same exception> ....
Any idea on what could be the reason?
Note: I have modified the file names and messages a little to hide organization specific details. Please let me know if you need any clarification.
The EAR/META-INF/jboss-deployment-structure.xml
file :
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<deployment>
<dependencies>
<module name="com.organization.global" export="true"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
I have several WAR files inside the EAR and each of those WAR files contain their own version of WAR/WEB-INF/jboss-deployment-structure.xml
and contain following:
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
<dependencies>
<module name="com.organization.global"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
The xml for EAR is inside META-INF but for the WARs, it resides under WEB-INF.
I had set the static modules com/organization/global
under EAP_MASTER_HOME/modules/
.
Deployment in standalone mode tries to deploy it only to the server running on master so the deployment works fine.
When I tried to deploy the EAR in domain mode, the server running on slave-eap was looking for the modules under EAP_SLAVE_HOME/modules/
.
Adding the static modules( or a symbolic link) under EAP_SLAVE_HOME/modules/
resolved the issue.