Author: kfujino Date: Mon Feb 23 02:34:50 2015 New Revision: 1661594 URL: http://svn.apache.org/r1661594 Log: When docBase refers internal war and unpackWARs is set to false, avoid registration of the invalid redeploy resource that has been added ".war" extension in duplicate.
Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java 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=1661594&r1=1661593&r2=1661594&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Mon Feb 23 02:34:50 2015 @@ -588,7 +588,8 @@ public class HostConfig // default to appBase dir + name expandedDocBase = new File(host.getAppBaseFile(), cn.getBaseName()); - if (context.getDocBase() != null) { + if (context.getDocBase() != null + && !context.getDocBase().toLowerCase(Locale.ENGLISH).endsWith(".war")) { // first assume docBase is absolute expandedDocBase = new File(context.getDocBase()); if (!expandedDocBase.isAbsolute()) { @@ -599,10 +600,14 @@ public class HostConfig // Add the eventual unpacked WAR and all the resources which will be // watched inside it - if (isExternalWar && unpackWARs) { - deployedApp.redeployResources.put(expandedDocBase.getAbsolutePath(), - Long.valueOf(expandedDocBase.lastModified())); - addWatchedResources(deployedApp, expandedDocBase.getAbsolutePath(), context); + if (isExternalWar) { + if (unpackWARs) { + deployedApp.redeployResources.put(expandedDocBase.getAbsolutePath(), + Long.valueOf(expandedDocBase.lastModified())); + addWatchedResources(deployedApp, expandedDocBase.getAbsolutePath(), context); + } else { + addWatchedResources(deployedApp, null, context); + } } else { // Find an existing matching war and expanded folder if (!isExternal) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org