简体   繁体   中英

deployment using jboss cli for domain mode fails to pick modules

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.

Standalone mode:

Put the ear inside standalone/deployment/ and start the server using ./standalone.sh : works fine.

Domain mode:

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.

Extra Info:

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.

Only the jboss-deployment-structure.xml from your EAR will be read. If sub-deployments need an additional module dependency you need to add that configuration to the EAR's descriptor.

You should remove the jboss-deployment-structure.xml from your WAR and change the one in the EAR to look like the following.

<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>
  <sub-deployment name="service-one-SNAPSHOT.war">
     <dependencies>
         <module name="com.organization.global" export="true"/>
     </dependencies>
  </sub-deployment>
</jboss-deployment-structure>

As to why it seems to deploy to a standalone server, that shouldn't be working. Deployments are processed exactly the same. If for it is working I'd say it's likely a bug somewhere.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM