Index: java/org/apache/catalina/ha/deploy/LocalStrings.properties =================================================================== --- java/org/apache/catalina/ha/deploy/LocalStrings.properties (revision 1653274) +++ java/org/apache/catalina/ha/deploy/LocalStrings.properties (working copy) @@ -45,3 +45,9 @@ farmWarDeployer.undeployEnd=Undeployment from [{0}] finished. farmWarDeployer.undeployLocal=Undeploy local context [{0}] farmWarDeployer.watchDir=Cluster deployment is watching [{0}] for changes. + +warWatcher.checking-wars=Checking WARs in {0} +warWatcher.listed-file-does-not-exist={0} was detected in {1} but does not exist. Check directory permissions on {1}? +warWatcher.checking-war=Checking WAR file {0} +warWatcher.check-war.result=WarInfo.check() returned {0} for {1} +warWatcher.cant-list-watchDir=Cannot list files in WatchDir "{0}": check to see if it is a directory and has read permissions. Index: java/org/apache/catalina/ha/deploy/WarWatcher.java =================================================================== --- java/org/apache/catalina/ha/deploy/WarWatcher.java (revision 1653274) +++ java/org/apache/catalina/ha/deploy/WarWatcher.java (working copy) @@ -23,6 +23,7 @@ import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; +import org.apache.tomcat.util.res.StringManager; /** * The WarWatcher watches the deployDir for changes made to the @@ -36,6 +37,8 @@ /*--Static Variables----------------------------------------*/ private static final Log log = LogFactory.getLog(WarWatcher.class); + private static final StringManager sm = + StringManager.getManager(Constants.Package); /*--Instance Variables--------------------------------------*/ /** @@ -67,20 +70,31 @@ */ public void check() { if (log.isDebugEnabled()) - log.debug("check cluster wars at " + watchDir); + log.debug(sm.getString("warWatcher.checking-wars", watchDir)); File[] list = watchDir.listFiles(new WarFilter()); - if (list == null) + if (list == null) { + log.warn(sm.getString("warWatcher.cant-list-watchDir", + watchDir)); + list = new File[0]; + } //first make sure all the files are listed in our current status for (int i = 0; i < list.length; i++) { + if(!list[i].exists()) + log.warn(sm.getString("warWatcher.listed-file-does-not-exist", + list[i], watchDir)); + addWarInfo(list[i]); } - //check all the status codes and update the FarmDeployer + // Check all the status codes and update the FarmDeployer for (Iterator> i = currentStatus.entrySet().iterator(); i.hasNext();) { Map.Entry entry = i.next(); WarInfo info = entry.getValue(); + if(log.isTraceEnabled()) + log.trace(sm.getString("warWatcher.checking-war", + info.getWar())); int check = info.check(); if (check == 1) { listener.fileModified(info.getWar()); @@ -89,6 +103,10 @@ //no need to keep in memory i.remove(); } + if(log.isTraceEnabled()) + log.trace(sm.getString("warWatcher.check-war.result", + Integer.valueOf(check), + info.getWar())); } }