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

commit d16a3555d314c87e6278e14a880154e6a8d830d4
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 c7ba2e4773..0df7a0712f 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -5215,7 +5215,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 d7f24d7c40..7a3b36c54c 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 10.1.61 (schultz)" 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 10.1.60 (schultz)" rtext="release in progress">
   <subsection name="Catalina">


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

Reply via email to