This is an automated email from the ASF dual-hosted git repository. rmaucher pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit fc02bad54076eef47553ab92a72b3c1730e35bae Author: opencode <[email protected]> AuthorDate: Wed Sep 30 22:58:55 2026 +0200 Log a clear configuration error and disable watching when FarmWarDeployer has watchEnabled set without a watchDir rather than failing with a NullPointerException on start --- java/org/apache/catalina/ha/deploy/FarmWarDeployer.java | 4 ++++ java/org/apache/catalina/ha/deploy/LocalStrings.properties | 1 + 2 files changed, 5 insertions(+) diff --git a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java index 44153cef9b..03df921611 100644 --- a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java +++ b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java @@ -168,6 +168,10 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer, log.error(sm.getString("farmWarDeployer.mbeanNameFail", engine.getName(), hostname), e); return; } + if (watchEnabled && getWatchDir() == null) { + log.error(sm.getString("farmWarDeployer.noWatchDir")); + watchEnabled = false; + } if (watchEnabled) { watcher = new WarWatcher(this, getWatchDirFile()); if (log.isInfoEnabled()) { diff --git a/java/org/apache/catalina/ha/deploy/LocalStrings.properties b/java/org/apache/catalina/ha/deploy/LocalStrings.properties index 50691f5128..db8c6436c1 100644 --- a/java/org/apache/catalina/ha/deploy/LocalStrings.properties +++ b/java/org/apache/catalina/ha/deploy/LocalStrings.properties @@ -25,6 +25,7 @@ farmWarDeployer.hostParentEngine=FarmWarDeployer can only work if parent of [{0} farmWarDeployer.mbeanNameFail=Cannot construct MBean object name for engine [{0}] and host [{1}] farmWarDeployer.modInstall=Installing webapp [{0}] from [{1}] farmWarDeployer.modInstallFail=Unable to install WAR file +farmWarDeployer.noWatchDir=The watchDir attribute must be set when watchEnabled is true. Watching for WAR file changes is disabled. farmWarDeployer.msgIoe=Unable to read farm deploy file message. farmWarDeployer.msgRxDeploy=Receive cluster deployment path [{0}], war [{1}] farmWarDeployer.msgRxUndeploy=Receive cluster undeployment from path [{0}] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
