By this rev I think that /META-INF/context.xml is added to redeployResources when copyXML is false.
Then, there is two question. Q1. After deploying war, the order of redeployResources becomes war -> directory -> /META-INF/context.xml. When /META-INF/context.xml is updated, the context is redeployed. Then, because /META-INF/context.xml already exists in the directory, the order of redeployResources becomes war -> /META-INF/context.xml -> directory. The next resource of the updated resource is deleted in HostConfig#checkResources. Therefore, when /META-INF/context.xml is updated again, the directory is deleted. However /META-INF/context.xml exists in the deleted directory. As a result, because updated /META-INF/context.xml is deleted, it might not be intended work. Q2. Is the addition of /META-INF/context.xml only deployment of the war? Need it for deployment of the directory? 2011/3/30 <ma...@apache.org>: > Author: markt > Date: Wed Mar 30 14:33:30 2011 > New Revision: 1086969 > > URL: http://svn.apache.org/viewvc?rev=1086969&view=rev > Log: > Correctly track changes to context.xml files and trigger redeployment when > copyXML is set to false > > Modified: > tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java > tomcat/trunk/webapps/docs/changelog.xml > > Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java > URL: > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=1086969&r1=1086968&r2=1086969&view=diff > ============================================================================== > --- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original) > +++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Wed Mar 30 > 14:33:30 2011 > @@ -777,8 +777,15 @@ public class HostConfig > JarEntry entry = null; > InputStream istream = null; > BufferedOutputStream ostream = null; > - File xml = new File > - (configBase(), file.substring(0, file.lastIndexOf(".")) + > ".xml"); > + File xml; > + if (copyXML) { > + xml = new File(configBase(), > + file.substring(0, file.lastIndexOf(".")) + ".xml"); > + } else { > + xml = new File(appBase(), > + file.substring(0, file.lastIndexOf(".")) + > + "/META-INF/context.xml"); > + } > boolean xmlInWar = false; > > if (deployXML && !xml.exists()) { > @@ -931,6 +938,10 @@ public class HostConfig > Long.valueOf(docBase.lastModified())); > addWatchedResources(deployedApp, docBase.getAbsolutePath(), > context); > + if (deployXML && !copyXML && xmlInWar) { > + deployedApp.redeployResources.put(xml.getAbsolutePath(), > + Long.valueOf(xml.lastModified())); > + } > } else { > addWatchedResources(deployedApp, null, context); > } > > Modified: tomcat/trunk/webapps/docs/changelog.xml > URL: > http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1086969&r1=1086968&r2=1086969&view=diff > ============================================================================== > --- tomcat/trunk/webapps/docs/changelog.xml (original) > +++ tomcat/trunk/webapps/docs/changelog.xml Wed Mar 30 14:33:30 2011 > @@ -119,6 +119,10 @@ > Provide a configuration option that lets the close method to be used > for > a JNDI Resource to be defined by the user. (markt) > </add> > + <fix> > + Correctly track changes to context.xml files and trigger redeployment > + when copyXML is set to false. (markt) > + </fix> > </changelog> > </subsection> > <subsection name="Coyote"> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > > -- Keiichi.Fujino --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org