tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Switching between releases during runtime
Date Tue, 08 Apr 2003 17:50:04 GMT
Hi Yoav,

Thanks for you reply!
My issue relates heavily to the "High availability Tomcat webapps using 
ant undeploy/deploy??" question I posted as well.

So far, I tried to create symlinks in UNIX (AIX 4.3), but had to discover 
the following:
Suppose the following directory structure:
/webapp/myapp-1.0 (webapp to be linked at)
/webapp/myapp-1.1 (next release to be switched to later)

What I did:
# create symlink
ln -s myapp-1.0 myapp # create a symlink to point to myapp
==> http://localhost:8080/myapp first gives a 404 not found. After a while 
(probably after Tomcat has created /work/Standalone/localhost/myapp with 
the contents of myapp-1.0) it works as expected.

# change symlink while tomcat is up & running
ln -sf myapp-1.1 myapp # force link creation, overwrites old symlink
==> will still give the contents of myapp-1.0, because the change is not 
recognized by tomcat, as the /work/Standalone/localhost/myapp directory 
and contents already exists.
Only stopping and starting Tomcat yields the expected result.

==> What can be done, to have a sort of "Context redirection", which 
allows creating a pointer which can be changed during runtime of tomcat??
This would lead to my 100% availability of webapps target being reached, 
as I can switch between releases after successfully testing them without 
any downtime.

Don't you think this would be a great thing to have in production? No 
downtime means no lost visitors!!

thx alot

"Shapira, Yoav" <> 
07.04.2003 15:04
Please respond to
"Tomcat Users List" <>

"Tomcat Users List" <>

RE: Switching between releases during runtime


>Thanks for your ideas, but how do they work out in the ant deploy
>scenario, where the application actually resides in "/usr/local/tomcat/
>work/Standalone/localhost/manager/forms.war" ?

The application does NOT reside in the work directory.  The application
resides at tomcat's appBase directory, typically $CATALINA_HOME/webapps,
or in your above example, /usr/local/tomcat/webapps.

>*) Is it an option to create a symlink "forms" in the /webapps
>to point to

Don't link into tomcat's work directory.  Don't depend on the contents,
structure, or organization (or existence!) of tomcat's work directory.

>*) The best thing would be a pseudo-context which simply points to
>context, so each request gets mapped to the versioned context.

My previous solution works on unix.  On windows, I'm aware of the
symlink trouble.  Yet another unfortunate consequence of that OS, but oh
well.  I would say redeploy everytime.  Or have the version in the
context name itself, e.g. have webapps/MyWebApp1.0 and
webapps/MyWebApp2.0.  You can use tomcat's manager to
stop/start/redeploy any version of your webapp then.

Yoav Shapira
Millennium ChemInformatics

This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, 
proprietary and/or privileged.  This e-mail is intended only for the 
individual(s) to whom it is addressed, and may not be saved, copied, 
printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your 
computer system and notify the sender.  Thank you.

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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message