tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Freitag <>
Subject Re: Error in Tomcat when redeploying the Web application
Date Thu, 03 Mar 2011 18:02:40 GMT
Hash: SHA1

Hi Keshav,

On 03/03/2011 05:07 PM, Keshav Arora wrote:
> Thomas,
> Thanks so much for your reply!
> Yes you are correct, we redeploy the application by copying the new version
> of war file to webapps folder. I've created a build script that builds the
> war file and copy it to Tomcat\webapps folder. Tomcat is installed on my
> local machine. So file is always copied on the same files system. Process
> was same when we were using Tomcat 6.0.29. So I'm not sure why we are
> getting the errors with Tomcat version 7.

Moving (or renaming as Konstantin suggested) on a filesystem is faster
than copying because only some filesystem metadata has to be changed.
Reason for the error could be different Tomcat behavior in context.xml
reading as Konstantin wrote.

> Can you please elaborate regarding context descriptor file?

You don't have to put your war files in the webapps directory another
option is to put a context descriptor file in conf/Catalina/localhost
which points to your war.
A Simple example: All war files are in a designated directory
/opt/mywars, Tomcat is installed in /opt/tomcat. You could deploy a
webapp w1 (/mywars/w1.war), by putting a file named w1.xml in
/opt/tomcat/conf/Catalina/localhost. The file should contain (at least)
the following:
<Context docBase="/opt/mywars/w1.war"/>

You should check if your war contains a META-INF/context.xml with
additional configuration, if yes put this in w1.xml as well. If you have
a new war file version, put it under /opt/mywars/w1_v<new>.war and
update the value of the docbase attribute in
/opt/tomcat/conf/Catalina/localhost/w1.xml. Tomcat will redeploy the app
for you. Context path will be /w1...

But I think the move or rename approach fits your needs for developement
purposes and is a bit simpler.

- -- 
Thomas Freitag
Version: GnuPG v1.4.10 (GNU/Linux)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message