Deploying on a running Tomcat server

It is possible to deploy web applications to a running Tomcat server.

If the Host autoDeploy attribute is “true”, the Host will attempt to deploy and update web applications dynamically, as needed, for example if a new .WAR is dropped into the appBase. For this to work, the Host needs to have background processing enabled which is the default configuration.

autoDeploy set to “true” and a running Tomcat allows for:

  • Deployment of .WAR files copied into the Host appBase.
  • Deployment of exploded web applications which are copied into the Host appBase.
  • Re-deployment of a web application which has already been deployed from a .WAR when the new .WAR is provided. In this case the exploded web application is removed, and the .WAR is expanded again. Note that the explosion will not occur if the Host is configured so that .WARs are not exploded with a unpackWARsattribute set to “false”, in which case the web application will be simply redeployed as a compressed archive.
  • Re-loading of a web application if the /WEB-INF/web.xml file (or any other resource defined as a WatchedResource) is updated.
  • Re-deployment of a web application if the Context Descriptor file from which the web application has been deployed is updated.
  • Re-deployment of dependent web applications if the global or per-host Context Descriptor file used by the web application is updated.
  • Re-deployment of a web application if a Context Descriptor file (with a filename corresponding to the Context path of the previously deployed web application) is added to the$CATALINA_BASE/conf/[enginename]/[hostname]/ directory.
  • Undeployment of a web application if its document base (docBase) is deleted. Note that on Windows, this assumes that anti-locking features are enabled, otherwise it is not possible to delete the resources of a running web application.

That web application reloading can also be configured in the loader, in which case loaded classes will be tracked for changes.

Deployment on Tomcat startup
Deploying using the Tomcat Manager

Get industry recognized certification – Contact us

keyboard_arrow_up