{"id":111,"date":"2008-06-17T15:38:12","date_gmt":"2008-06-17T20:38:12","guid":{"rendered":"http:\/\/stein.everybody.org\/brain\/tomcat-deletes-context-descriptor-on-redeployment\/"},"modified":"2011-03-10T10:57:27","modified_gmt":"2011-03-10T15:57:27","slug":"tomcat-deletes-context-descriptor-on-redeployment","status":"publish","type":"post","link":"https:\/\/jeremystein.com\/brain\/tomcat-deletes-context-descriptor-on-redeployment\/","title":{"rendered":"Tomcat deletes context descriptor on redeployment"},"content":{"rendered":"<p>I like to put machine-specific configuration in the context descriptor outside of the WAR.  However, when I drop in a new WAR on a running Tomcat instance, Tomcat deletes my context descriptor.  (No, there is no context descriptor in the WAR.)  I wanted to be able to deploy an updated web application without restarting Tomcat and using the machine-specific configuration in conf\/Catalina\/localhost\/myapp.xml.  But when I drop in the WAR, my configuration file is destroyed.<\/p>\n<p>Steps to reproduce (I&#8217;m on Windows XP with Java 1.5):<br \/>\n1) Download Tomcat 5.5.26 and unzip<br \/>\n2) Create conf\/Catalina\/localhost\/test.xml<br \/>\n3) Create a webapps\/test.war containing some simple files (no META-INF directory)<br \/>\n4) Start tomcat<br \/>\n5) Create a new test.war and copy over the old one<br \/>\n6) Note that conf\/Catalina\/localhost\/test.xml has disappeared<\/p>\n<p>It looks like it&#8217;s back to using server.xml.  Apache <a href=\"https:\/\/issues.apache.org\/bugzilla\/show_bug.cgi?id=34840\">refuses<\/a> to fix this, even though the separate-file-per-context was clearly <a href=\"http:\/\/tomcat.apache.org\/tomcat-5.5-doc\/config\/context.html\">intended<\/a> to replace context-specific changes in server.xml.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I like to put machine-specific configuration in the context descriptor outside of the WAR. However, when I drop in a new WAR on a running Tomcat instance, Tomcat deletes my context descriptor. (No, there is no context descriptor in the WAR.) I wanted to be able to deploy an updated web application without restarting Tomcat [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[],"class_list":["post-111","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":0,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"wp:attachment":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}