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 f8dca265fa Fix Stackoverflow reported in some Spring Boot 
configurations
f8dca265fa is described below

commit f8dca265faf4adc1ff23b0da9c67d4a9d6959c66
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Sep 10 15:43:15 2026 +0100

    Fix Stackoverflow reported in some Spring Boot configurations
    
    https://github.com/spring-projects/spring-boot/issues/50651
---
 java/org/apache/catalina/core/StandardContext.java | 5 ++++-
 webapps/docs/changelog.xml                         | 9 +++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/core/StandardContext.java 
b/java/org/apache/catalina/core/StandardContext.java
index d073dcf626..09160f953a 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -5185,7 +5185,10 @@ public class StandardContext extends ContainerBase 
implements Context, Notificat
         Loader loader = getLoader();
         ClassLoader webApplicationClassLoader = null;
         if (loader != null) {
-            webApplicationClassLoader = loader.getClassLoader();
+            // Don't bind the web application class loader if it isn't started 
yet.
+            if (!(loader instanceof Lifecycle) || ((Lifecycle) 
loader).getState().isAvailable()) {
+                webApplicationClassLoader = loader.getClassLoader();
+            }
         }
 
         Thread currentThread = Thread.currentThread();
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 234d145d8f..fc9985558d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -108,6 +108,15 @@
   issues do not "pop up" wrt. others).
 -->
 <section name="Tomcat 11.0.27 (markt)" rtext="in development">
+  <subsection name="Catalina">
+    <changelog>
+      <fix>
+        When starting a web application, don't try and use the web application
+        class loader until after the web application class loader has started.
+        (markt)
+      </fix>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 11.0.26 (markt)" rtext="release in progress">
   <subsection name="Catalina">


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

Reply via email to