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 09cf088ac6 Align load() error handling with server.start() error
handling
09cf088ac6 is described below
commit 09cf088ac67eda16b1b4df65b69cf6f625f4ee66
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 7fa1be7ddf..1feded95d6 100644
--- a/java/org/apache/catalina/startup/Catalina.java
+++ b/java/org/apache/catalina/startup/Catalina.java
@@ -874,7 +874,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]