1
votes

Tomcat is behaving oddly. Our app runs fine.

Sometimes (not all the time) we stop tomcat and replace our war file. When we start tomcat back up, no errors are reported, but the war file is not always deployed. File and folder dates are from the previous build. When that occurs, blowing away the deployed directory and restarting tomcat WILL deploy the entire war file.

At other times, deleting the deployed directories and files and restarting tomcat will result in a PARTIAL deployment. The entire .war file does not get unzipped. As before, no errors are reported.

At other times, everything appears to work. This happens to us on both unix and windows. Running tomcat 7 and tomcat 8.

I'm not asking what the problem IS, I'm trying to figure out how to debug the deploy mechanism in tomcat. Is there something i can set so i can watch it deploy?

1

1 Answers

0
votes

There are two kinds of deploys, hot deploys and cold deploys. Hot deploys (preferred) are when tomcat is left up and running. a COLD deploy occurs when you stop tomcat. When that happens, you must manually remove the directory under webapps/.

According to: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2013517,

The previous version of an application remains deployed

  • Under the defaults, this strategy typically does not work as desired. With unpackWARs="true", the auto-deployer exploded the previous version of the app into a directory. When Tomcat is restarted with an updated WAR, according to the deployment sequence, the WAR file is ignored, and either a context descriptor or the directory is deployed. Therefore the previous version of the app is deployed, not the updated version in the WAR.

  • In order to cold deploy correctly, in addition to updating the WAR file, remove the exploded directory from webapps/ and any context descriptor from the app in conf/Catalina/localhost/. Then the auto-deployer uses the updated WAR file for deployment at startup.