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

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


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

commit 94651ea5e470aad2a02c2de3edaa8c6411e89cbe
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 6bcf638e4e..8167b389fd 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);
+                                }
                                 if (!factory.getFile().renameTo(deployable)) {
                                     log.error(
                                             
sm.getString("farmWarDeployer.renameFail", factory.getFile(), deployable));
@@ -482,7 +485,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()) {
@@ -493,6 +495,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