Author: markt Date: Tue Feb 27 21:50:27 2018 New Revision: 1825508 URL: http://svn.apache.org/viewvc?rev=1825508&view=rev Log: When a deployment descriptor is deployed that references an external docBase and, as a result, a docBase under the appBase will be ignored, log a warning.
Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties 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=1825508&r1=1825507&r2=1825508&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Tue Feb 27 21:50:27 2018 @@ -608,6 +608,17 @@ public class HostConfig implements Lifec if (docBase.getAbsolutePath().toLowerCase(Locale.ENGLISH).endsWith(".war")) { isExternalWar = true; } + // Check that a WAR or DIR in the appBase is not 'hidden' + File war = new File(host.getAppBaseFile(), cn.getBaseName() + ".war"); + if (war.exists()) { + log.warn(sm.getString("hostConfig.deployDescriptor.hiddenWar", + contextXml.getAbsolutePath(), war.getAbsolutePath())); + } + File dir = new File(host.getAppBaseFile(), cn.getBaseName()); + if (dir.exists()) { + log.warn(sm.getString("hostConfig.deployDescriptor.hiddenDir", + contextXml.getAbsolutePath(), dir.getAbsolutePath())); + } } else { log.warn(sm.getString("hostConfig.deployDescriptor.localDocBaseSpecified", docBase)); Modified: tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties?rev=1825508&r1=1825507&r2=1825508&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties Tue Feb 27 21:50:27 2018 @@ -98,6 +98,8 @@ hostConfig.deployDescriptor=Deploying de hostConfig.deployDescriptor.blocked=The web application with context path [{0}] was not deployed because it contained a deployment descriptor [{1}] which may include configuration necessary for the secure deployment of the application but processing of deployment descriptors is prevented by the deployXML setting of this host. An appropriate descriptor should be created at [{2}] to deploy this application. hostConfig.deployDescriptor.error=Error deploying deployment descriptor [{0}] hostConfig.deployDescriptor.finished=Deployment of deployment descriptor [{0}] has finished in [{1}] ms +hostConfig.deployDescriptor.hiddenDir=Deployment of deployment descriptor [{0}] with an external docBase means the directory [{1}] in the appBase will be ignored +hostConfig.deployDescriptor.hiddenWar=Deployment of deployment descriptor [{0}] with an external docBase means the WAR [{1}] in the appBase will be ignored hostConfig.deployDescriptor.localDocBaseSpecified=A docBase [{0}] inside the host appBase has been specified, and will be ignored hostConfig.deployDescriptor.path=The path attribute with value [{0}] in deployment descriptor [{1}] has been ignored hostConfig.deployDescriptor.threaded.error=Error waiting for multi-thread deployment of deployment descriptors to complete Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1825508&r1=1825507&r2=1825508&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Tue Feb 27 21:50:27 2018 @@ -107,6 +107,11 @@ <code>path</code> attribute, log a warning that the <code>path</code> attribute will be ignored. (markt) </add> + <add> + When a deployment descriptor is deployed that references an external + <code>docBase</code> and, as a result, a <code>docBase</code> under the + <code>appBase</code> will be ignored, log a warning. (markt) + </add> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org