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 9378c7823e Align load() error handling with server.start() error 
handling
9378c7823e is described below

commit 9378c7823ee39b71f7eba378d6b507a985882c59
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Sep 17 14:43:05 2026 +0100

    Align load() error handling with server.start() error handling
---
 java/org/apache/catalina/startup/Catalina.java | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/startup/Catalina.java 
b/java/org/apache/catalina/startup/Catalina.java
index 141f458128..a8f006fbb1 100644
--- a/java/org/apache/catalina/startup/Catalina.java
+++ b/java/org/apache/catalina/startup/Catalina.java
@@ -852,7 +852,21 @@ public class Catalina {
     public void start() {
 
         if (getServer() == null) {
-            load();
+            try {
+                load();
+            } catch (Throwable t) {
+                // Re-throw critical errors immediately. Otherwise, try and 
clean-up first.
+                ExceptionUtils.handleThrowable(t);
+                log.fatal(sm.getString("catalina.initError"), t);
+                if (getServer() != null) {
+                    try {
+                        getServer().destroy();
+                    } catch (LifecycleException e) {
+                        log.debug(sm.getString("catalina.destroyFail"), e);
+                    }
+                }
+                return;
+            }
         }
 
         if (getServer() == null) {


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

Reply via email to