Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Class loading issues due to thread context classloader hierarchy (Spring Web Reactive + Tomcat) [SPR-14932] #19499
This is the scenario:
When using Spring Web Reactive in a Spring Boot 2.0.0 (snapshot) application, if Tomcat is used as a server, a
Example application: https://github.com/danielfernandez/test-spring-boot-tomcat
The above application replicates the scenario with Spring Boot 1.4.2 and 2.0.0, using Spring Web MVC and Spring Web Reactive (in 2.0.0). Spring Web Reactive is tested both using Netty and Tomcat. Only Tomcat fails.
This is possibly due to the hierarchy of the thread context class loader. Let's compare:
Thread context class loader in Spring Boot 2.0.0, Spring Web MVC 5.0.0, Tomcat:
Thread context class loader in Spring Boot 2.0.0, Spring Web Reactive 5.0.0, Netty:
Thread context class loader in Spring Boot 2.0.0, Spring Web Reactive 5.0.0, Tomcat:
Please see the
This affects the integration of Thymeleaf into applications using Spring Web Reactive. Thymeleaf needs to initialise some implementations depending on the specific scenario it is being run on, and this issue makes it impossible to use the current version of the Thymeleaf + Spring integration packages in Spring Web Reactive applications using Tomcat.
Affects: 5.0 M3
Reference URL: https://github.com/danielfernandez/test-spring-boot-tomcat
Brian Clozel commented
Thanks a lot Daniel Fernández for this super thorough bug report and repro applications.
I've just fixed this issue by using the
I'm resolving this as invalid since this issue is about the experimental Spring Boot reactive web starter and I don't want to mislead people since no commit in Framework fixed this.