Mark Thomas wrote:
Erwin Hogeweg wrote:
Hi,

I am trying to re-deploy a war file on a RHES 5.2/Tomcat 6.0.16 server,
but the war file does not expand when Tomcat is restarted.

I have set the host variable deployOnStartup to "true", but even though
the war file has a newer timestamp that the deployed folder the file is
not re-deployed.
That sounds like normal behaviour to me. If updating a WAR whilst Tomcat is
not running, I would expect to have to remove the old WAR and old expanded
directory. I would also clean out the work directory just to be on the safe
side.

The file IS redeployed when I 'touch' the war file while Tomcat is
running, or when the expanded folder does not exist.
Again, I am pretty sure that is what was intended.

The catalina.out log file shows Deploying MyWar.war, but nothing really
happens.

Is there any specific debug logging that I can enable which shows me
what is going on?
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java?revision=675650&view=markup
is the source that is handles deployments. The WAR unpacking is handled by
ContextConfig in the same package.

Some additional logging is available if you turn up logging for these
classes. Add:
org.apache.catalina.startup.HostConfig=FINE
org.apache.catalina.startup.ContextConfig=FINE

to your logging.properties

Mark

Translation : ;-)

Tomcat does not "remember" the age of war files, between a stop and a start. (In fact, Tomcat probably does not remember anything between a stop and a start).

If you stop Tomcat, then replace just the war file, then restart Tomcat,
Tomcat looks at the *deployed* application, sees it's still there, and does not check the war file. (And apparently in that case, it does not compare the age of the deployed application files with the war timestamp)(and probably rightly so, because that might be "expensive")

If you stop Tomcat, then replace the war file and delete the deployed application, then restart Tomcat, Tomcat looks at the *deployed* application, sees it's not there, and thus deploys the war file. As long as you do not stop Tomcat, it remembers the timestamp of the war file.

If you do not stop Tomcat and replace the war file, Tomcat notices that its timestamp has changed, and redeploys it, overwriting the previously-deployed version. (or more probably it first stops and deletes the previous application entirely, before re-deploying the war file).

(All the above assuming deployOnStartup="true" and autoDeploy="true")

Correct, Mark ?



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

Reply via email to