You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Gordan Krešić <go...@os.t-com.hr> on 2007/10/15 15:34:26 UTC

Upgrading context - requires Tomcat restart?

Hi to all,

I'm running multiple webapps on several hosts, usually one webapp per host
as root context. Webapps are located in /usr/local/webapps and I provide my
custom context files in $CATALINA_HOME/cont/Catalina/[host]/ROOT.xml

In /usr/local/webapps I save my applications in folders webapp_name-version
and then symlink webapp_name to apropriate version. For example:

gkresic@koka:/usr/local/webapps$ dir
lrwxrwxrwx 1 root root   10 2007-10-15 12:14 jura -> jura-1.2.1
drwxr-xr-x 3 root root 4096 2007-07-05 13:28 jura-1.2.1
drwxr-xr-x 3 root root 4096 2007-10-15 12:06 jura-1.2.2
gkresic@koka:/usr/local/webapps$

"jura-1.2.1" - application currently running
"jura-1.2.2" - newely uploaded version

In context file ($CATALINA_HOME/cont/Catalina/[host]/ROOT.xml) I've
configured docBase to point to /usr/local/webapps/jura (symlink). My idea
was to perform upgrade in safe fashion:

1. upload new application fo folder webapp-version (jura-1.2.2 in upper example)
2. symlink webapp to point to webapp-version (jura -> jura-1.2.2)
3. reload application

Unfortunally, this does not work. After reload, Tomcat still loads old
application (that symlink pointed to before upgrade). Question is why and
how to force Tomcat to load upgraded application?

Of course, if I restart Tomcat new application version is propery started.

If I remember correctly, this worked in Tomcat 5.0, In Tomcat 5.5 required
one "touch" on application's context file to trigger reload, but on Tomcat 6
I can't find any way to force Tomcat to re-read webapps dir.

Both "reloadable" and "allowLinking" attribute in context file seems to have
no effect.

I've even tried to change docBase in context file (ROOT.xml) to point to
real webapp's directory (instead of symlink), but after every reload, Tomcat
still loads webapp that context file pointed to when Tomcat was started.

Any other ideas? How do you perform webapp's upgrade?

My setup:

Debian Etch
Stock (not-from-repository) Tomcat 6.0.13
Starting Tomcat via jsvc
J2SE 1.6

Tny in advance,

	-gkresic.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Upgrading context - requires Tomcat restart?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gordan,

Gordan Krešić wrote:
> Unfortunally, this does not work. After reload, Tomcat still loads old
> application (that symlink pointed to before upgrade). Question is why and
> how to force Tomcat to load upgraded application?

My guess is that Tomcat either requests a true path (which then uses the
real name of the directory, instead of the symlink) to the webapp, or
the OS does it at a lower-level and so changes to the symlink have no
effect on Tomcat while it is running.

> Any other ideas? How do you perform webapp's upgrade?

Updating the WAR file ought to work if you have autoDeploy="true". Why
not use ROOT.war and just copy the most up-to-date WAR file into the
deployment directory?

You can always have a version history somewhere else.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHE3Eh9CaO5/Lv0PARAtIbAJ9DA1TurDijlHlCbyMacboVRERrAwCfQmlA
QA2Rj0GJD5yYN/kpMlSasRI=
=NC9n
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org