It appears that it is not possible to re-deploy a web application while the server is running without Tomcat cleaning up the context in /conf/Catalina/localhost/. We want in server.xml <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false"> Currently, the context file /conf/Catalina/localhost/appName.xml is deleted on the undeploy part of the re-deploy cycle. We do not want the deletion of this file. We want a genuine update of the application that can be executed via the manager console by just overwriting the existing .war file. Currently, the manager application requires an undeployment first which cleans up the configuration. Or in other words, we want some means of updating the running application in a controlled fashion for production use. With controlled fashion we mean that we don't want to be exposed to the complexity that comes with autoDeploy="false". From our perspective, the manager application should have the capability to upload and overwrite an existing .war file, explode it and reload the application without deleting the context. We do not want to put the context into the war file because it contains installation specific configuration.
Sorry I should have written: With controlled fashion we mean that we don't want to be exposed to the complexity that comes with autoDeploy="true".
You should be able to use the Manager text interface to do that. The update option isn't avaialble in the HTML UI. We should look at adding that.
Thanks Mark for the info. I looked again at https://tomcat.apache.org/tomcat-8.0-doc/manager-howto.html#Reload_An_Existing_Application With http://host:port/manager/text/deploy?path=/mypath&update=true&war=jar:file:/tomcat/mywardr/mypath.war!/ FAIL - Deployed application at context path /mypath but context failed to start I could not figure out how to use the update parameter in any of the commands without getting an undeploy and subsequent context xml file loss.
I think the docs need fixing. Try something like this: http://localhost:8080/manager/text/deploy?war=file:/d:/test1.war&path=/test&update=true http://localhost:8080/manager/text/deploy?war=file:/d:/test2.war&path=/test&update=true This works for me. It swaps between test1.war and test2.war deployed as test.war and $CATALINA_BASE/conf/Catalina/localhost/test.xml remains untouched
I've updated the docs to remove the (very) out of date references to using jar:file: URLs. The fix has been applied to 9.0.x for 9.0.0.M3, 8.0.x for 8.0.33, 7.0.x 7.0.68 and 6.0.x for 6.0.46 onwards.
Thanks for the command line options. Would you please clarify in which release the update option will be available in the HTML UI. Many thanks.
Could we have juste an option to prevent it from happening ? So there will be no probleme of retrocompatibility.
Tomcat 8 has reached End Of Life. Moving this bug to Tomcat 9.
Correct component after move to Tomcat 9.