3

I'm running an Wildfly 9 Application-Server and everything is deployed with "mvn clean install wildfly:deploy" except 2 War Files that are in the wildfly/standalone/deployments folder and are deployed automatically.

My Problem now is: Every other package has to use the 2 war Files (because its a database) and i can't find a way to tell Wildfly to first deploy the files in the deployment folder and then start to deploy the rest.

At the moment i'm working with TimerServices for each Package till the Database is deployed and running, but that is a real bad solution in my Opinion.

Do you know a way to solve this?

Thx in advance

Error 404
  • 105
  • 2
  • 10
  • How are you defining the dependencies between "everything else" and the "2 war files"? – James R. Perkins Mar 28 '16 at 18:47
  • There is no coded dependency at the moment. All modules just try to write something into the Database, if that didn't work they start a TimerService which starts in 5 Seconds and retrys every 5 Seconds when failed. – Error 404 Mar 30 '16 at 17:36

1 Answers1

2

You could create a jboss-deployment-structure.xml to build a dependency from your deployments.

For example, assuming your two wars deployed automatically are named 'alpha.war'/ 'betha.war' and your 'dependent' deployment is called 'omega.war', you just have to create (or edit) the file:

omega.war/WEB-INF(or META-INF for ears)/jboss-deployment-structure.xml with the content...

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module export="true" name="deployment.alpha.war"/>
            <module export="true" name="deployment.betha.war"/>
        </dependencies>
    </deployment>
</jboss-deployment-structure>
Ozwizard
  • 99
  • 1
  • 5
  • Thx for the answer, but it's not working as expected. I can see in the Logs that Wildfly accepted the jboss-deployment-structure.xml but still all modules start to deploy at the same time and some of them get deployed earlier than the database. What i see is that the Modules are just waiting for the Start of deploying of the database, not for the real finish of the deploying. – Error 404 Mar 24 '16 at 19:42