Note that there are some explanatory texts on larger screens.

plurals
  1. POTomcat context management
    primarykey
    data
    text
    <p>The tomcat 6.0 document at <a href="http://tomcat.apache.org/tomcat-6.0-doc/config/context.html" rel="nofollow">http://tomcat.apache.org/tomcat-6.0-doc/config/context.html</a> says:</p> <blockquote> <p>Only if a context file does not exist for the application in the <code>$CATALINA_BASE/conf/[enginename]/[hostname]/</code>, in an individual file at <code>/META-INF/context.xml</code> inside the application files. If the web application is packaged as a WAR then <code>/META-INF/context.xml</code> will be copied to <code>$CATALINA_BASE/conf/[enginename]/[hostname]/</code> and renamed to match the application's context path. <strong>Once this file exists, it will not be replaced if a new WAR with a newer <code>/META-INF/context.xml</code> is placed in the host's appBase</strong>.</p> </blockquote> <p>However I noticed that if you put new war file in webapp directory, the <code>context.xml</code> in <code>META-INF</code> directory replaces <code>context.xml</code> in <code>$CATALINA_BASE/conf/[enginename]/[hostname]</code>.</p> <p>Is there any configuration which makes sure that <code>context.xml</code> in <code>$CATALINA_BASE/conf/[enginename]/[hostname]/</code> is not overwritten whenever new war file is deployed.</p> <p><strong>Edit:</strong> I am using autodeploy="true" From the comment of JoseK, I understand when tomcat sees new war file, it undeploys old application (leading to deletion of context file) and deploys the the new war file (leading to creation of new war file). In that case the above information from tomcat document is not relavant. The new question can there be any situation where the above thing can happen?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload