Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 406
user1821266 Avatar asked Nov 13 '12 16:11

user1821266


2 Answers

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!

like image 103
uaarkoti Avatar answered Nov 11 '22 09:11

uaarkoti


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.

like image 27
uylmz Avatar answered Nov 11 '22 08:11

uylmz