6

I have multiple war files to deploy, for example. coll.war, egg.war, etc., each one will specify an application module.

In our application I have some specification that coll.war should deploy first and rest has to deploy in specific sequence such like.

  1. coll.war
  2. egg.war
  3. chick.war

Can somebody help me out to do it.

Janak Dhanani
  • 214
  • 4
  • 12
ashokramcse
  • 2,841
  • 2
  • 19
  • 41

2 Answers2

1

In server.xml inside servers folders it will add a entry for every war you added.Delete those entries.

Then create the xml files which have the following content and name the xml files in order inside the conf\Catalina{server_name} folder.

Example :

coll.xml

 <?xml version='1.0' encoding='utf-8'?>
 <Context docBase="${catalina.home}/deploy/collWAR" crossContext="true">
 </Context>
SANN3
  • 9,459
  • 6
  • 61
  • 97
  • 2
    I got same problem to sequentially deploy war on Tomcat 7 on same server without changing any port, any one can help me for with this solution and explain how it is possible . – Janak Dhanani Apr 23 '14 at 04:32
0

see the answer for tomcat6. Part of the answer is that not even the servlet spec specifies an order. Also, it contains various pointers on how to solve the problem in different ways than through application-server-based deployment order

I am not aware that anything in tomcat7 changed the assumptions, so that the linked answer should be sufficient, even if you're on tomcat7, not tomcat6

To make it more explicit, promoting a comment into the answer:

That answer wouldn't help you do what you're asking (because it explicitly states that tomcat is not providing this option), but it links to the tomcat wiki with workarounds, mentions different solutions to the problem with Zeroconf, etc.. This means that your underlying problem with inter-dependent WAR files can be solved, just not necessarily by specifying app-server's deployment order.

Community
  • 1
  • 1
Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
  • On the above link it seems that sequential deployment for the war was not possible in Tomcat it seems. How would your answer helps me to do it? – ashokramcse Mar 04 '14 at 13:16
  • 2
    It wouldn't help you *do* it (because it explicitly says that tomcat is not providing such an option), but link to the tomcat wiki with workarounds, mention different solutions to the problem with Zeroconf, etc.. This means that your underlying problem with inter-dependent WAR files can be solved, just not necessarily with deployment order. – Olaf Kock Mar 04 '14 at 13:34