From: markt Date: Wed, 21 Oct 2009 20:53:47 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48009 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=64cf6622f8fc1a4a0c0bdfa08bd9a6edba9a1d93;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48009 Add a check in case the file is in the middle of being renamed. It isn't perfect (it can't be) but this should cover most cases git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@828210 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/startup/HostConfig.java b/java/org/apache/catalina/startup/HostConfig.java index 9ff98b78a..3d2882590 100644 --- a/java/org/apache/catalina/startup/HostConfig.java +++ b/java/org/apache/catalina/startup/HostConfig.java @@ -1103,6 +1103,17 @@ public class HostConfig return; } } else { + // There is a chance the the resource was only missing + // temporarily eg renamed during a text editor save + try { + Thread.sleep(500); + } catch (InterruptedException e1) { + // Ignore + } + // Recheck the resource to see if it was really deleted + if (resource.exists()) { + continue; + } long lastModified = app.redeployResources.get(resources[i]).longValue(); if (lastModified == 0L) {