JBoss AS 7 - Deploying wars in certain order
Asked Answered
L

2

8

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?

Losel answered 13/11, 2012 at 16:35 Comment(1)
How are you deploying ?? Using an IDE/jboss admin console/conf??Stromberg
L
5

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!

Levorotation answered 13/11, 2012 at 16:47 Comment(5)
I've already tried to do what you told me, but the jboss-deployment-structure.xml file is created in a tmp folder (\standalone\tmp\vfs..) when i do the deploy, so i can't change it until the deploy is done.Losel
dont work for jboss 7. try to find the ear in modules and is in deploymentAnabaptist
You are supposed to add that file before the war/ear is deployed to JBoss. The war/ear packaging should package that file. For ex: If you are using Maven to build the package, make sure that file is there in the appropriate location (as mentioned above) before executing the maven build.Levorotation
I tried this solution, but I get a"ModuleNotFoundException" telling that the module specified in the jboss-deployment-structure.xml does not existHulk
is there a similar solution for EAP 7 ?Myoglobin
F
3

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.

Fluctuate answered 22/7, 2015 at 11:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.