This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new f8d482b7f5 Follow up to "Avoid logging a spurious delete failure..."
f8d482b7f5 is described below
commit f8d482b7f56c164310b11fc261773e1b90f61c7f
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 45db5214e6..526cc6a5d4 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]