9

I've some issue regarding the deployment order of two applications inside Wildfly 8.1. The problem is that some modules of app2.ear depends of modules from app1.ear, but app1.ear is deployed after app2.ear.

I've tried to specify a dependency for app1 like this:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <deployment>
    <dependencies>
        <module name="app2.ear" />
    </dependencies> 
  </deployment>
</jboss-deployment-structure>

But no luck, app1.ear fails to deploy with this error:

{"JBAS014671: Failed services" ... Caused by: org.jboss.modules.ModuleNotFoundException: app2.ear:main"}}

Any idea if it is possible and how to dot it ?

Thx in advance.

Beryllium
  • 12,808
  • 10
  • 56
  • 86
Starena
  • 103
  • 1
  • 5

1 Answers1

10

Specify the dependencies in META-INF/jboss-all.xml.

So for your app2.ear it can look like:

<jboss xmlns="urn:jboss:1.0">
    <jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
        <dependency name="app1.ear" />
    </jboss-deployment-dependencies>
</jboss>
kwart
  • 3,154
  • 1
  • 21
  • 22
  • Thanks, it works perfectly. I was thinking that this method was for previous Jboss versions. – Starena Sep 02 '14 at 08:39
  • For those here looking for the solution, it might be useful to know that an ear expects its reasources to be in `src/main/application` instead of `src/main/resources`! You should thus put your `jboss-all.xml` in `src/main/application`. – froginvasion Jan 12 '17 at 14:33
  • in hope that someone will look at this old thread. Does this jboss-all specify a necessity or a depedency ? I.e does the dependecy need to exist, or exist and be deployed ? Will the dependant wait for it to deploy first ? – yourAverageDeveloper Oct 16 '19 at 08:00
  • If I recall it correctly, the app2 deployment will fail when the app1.ear is not already deployed. – kwart Oct 17 '19 at 19:52