How to make tomcat load one web application before another?


I think the simplest solution is to do manual context entries in [TOMCAT_HOME]/server/conf.xml file and define the priorities in there. Lets say if you have two web applications WebApp1 and WebApp2 and you want WebApp1 to load before WebApp2.

Make two entries in [TOMCAT_HOME]/conf/server.xml as shown below:

<Context path=“WebApp1” docBase=“PATH_TO_WEBAPP1” debug=“0”/>
<Context path=“WebApp2” docBase=“PATH_TO_WEBAPP2” debug=“0”/>

The context entry for WebApp1 should come before the entry of WebApp2

Note: Make sure you are not copying any war files for your web application in the webapps directory otherwise this will load up the applicaiton twice because by default the webapps direcotry is configured to be [TOMCAT_HOME]/webapps

Advertisements
How to make tomcat load one web application before another?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s