user1821266
user1821266

Reputation: 81

JBoss AS 7 - Deploying wars in certain order

Im trying to deploy some .war files in a standalone mode, the problem is that i need them to be deployed in a certain order... I have: file1.war, file2.war, file3.war and i have to deploy first file2.war, then file3.war and finally file1.war

I've seen lots of posts but all the answers i get are for previous versions of Jboss

can anyone help me please?

Upvotes: 8

Views: 8569

Answers (2)

uylmz
uylmz

Reputation: 1552

jboss-deployment-structure.xml is about classloaders, for example one war has a provided dependency on another deployment etc. I think what you are looking for is:

Control the order of Deployed Applications on JBoss EAP 6

This way, one deployment depends on another's services, such as EJB's, so you ensure they deploy in correct order.

Upvotes: 3

uaarkoti
uaarkoti

Reputation: 3657

I am not really sure what your use case is but controlling ordering is not the optimal way to deploy because JBoss tries to do parallel deployments to speed up the process, if you should do that then you can provide dependencies of each deployment on another. For example if you want file2.war to deploy after file1.war, you should provide a dependency of file2.war on file1.war as shown below in your jboss-deployment-structure.xml (stored in META-INF for ears and WEB-INF in wars)

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
  <deployment>
    <dependencies>
      <module name="deployment.file1.ear" />
    </dependencies>
  </deployment>
</jboss-deployment-structure>

Again, trying to micro manage the deployments is rarely necessary but use this with caution.

Good luck!

Upvotes: 5

Related Questions