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

markt-asf pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
     new d5fab78d83 Follow up to "Avoid logging a spurious delete failure..."
d5fab78d83 is described below

commit d5fab78d83cc44d05264aa5a6de269d6b3b02dea
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Oct 2 13:33:01 2026 +0100

    Follow up to "Avoid logging a spurious delete failure..."
    
    Avoid logging a warning for a new deployment
---
 java/org/apache/catalina/ha/deploy/FarmWarDeployer.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java 
b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
index 7b539a0ca2..d36faf47bd 100644
--- a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
+++ b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
@@ -240,7 +240,10 @@ public class FarmWarDeployer extends ClusterListener 
implements ClusterDeployer,
                         String contextName = fmsg.getContextName();
                         if (tryAddServiced(contextName)) {
                             try {
-                                remove(contextName);
+                                Context context = (Context) 
host.findChild(contextName);
+                                if (context != null) {
+                                    remove(contextName);
+                                }
 
                                 // Replace an existing file since the delete of
                                 // an old WAR may have failed earlier
@@ -486,7 +489,6 @@ public class FarmWarDeployer extends ClusterListener 
implements ClusterDeployer,
      */
     protected void remove(String contextName) throws Exception {
         // TODO Handle remove also work dir content !
-        // Stop the context first to be nicer
         Context context = (Context) host.findChild(contextName);
         if (context == null) {
             if (log.isWarnEnabled()) {
@@ -497,6 +499,7 @@ public class FarmWarDeployer extends ClusterListener 
implements ClusterDeployer,
         if (log.isDebugEnabled()) {
             log.debug(sm.getString("farmWarDeployer.undeployLocal", 
contextName));
         }
+        // Stop the context first to be nicer
         context.stop();
         String baseName = context.getBaseName();
         File war = new File(host.getAppBaseFile(), baseName + ".war");


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to