This is an automated email from the ASF dual-hosted git repository.

rmaucher pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit aaf99231eac762881c688b9a07931540115e7ae2
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 53d05a2993..73702c5482 100644
--- a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
+++ b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
@@ -167,6 +167,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 5d885bc60d..5491936b65 100644
--- a/java/org/apache/catalina/ha/deploy/LocalStrings.properties
+++ b/java/org/apache/catalina/ha/deploy/LocalStrings.properties
@@ -28,6 +28,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]

Reply via email to