Description:
I recently upgraded a Spring Boot application from 1.5.7 to 3.4.x and Java from 8 to 21. After the upgrade, the application starts successfully, but when I try to access the login page, it gets stuck in a redirection loop. The console logs show the following error:
log
ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [/GFEPWeb] threw exception
[Handler processing failed: java.lang.NoClassDefFoundError: org/unbescape/html/HtmlEscape]
Caused by: java.lang.ClassNotFoundException: org.unbescape.html.HtmlEscape
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
Updated Thymeleaf dependencies in pom.xml:
org.thymeleaf
thymeleaf
3.1.2.RELEASE
org.unbescape
unbescape
1.1.6.RELEASE
What I’ve Tried So Far:
Checked that thymeleaf and unbescape dependencies are present
Cleared the browser cache and restarted the server
Verified that the dependency versions are compatible with Spring Boot 3.4
Checked thymeleaf-extras dependencies
Expected vs. Actual Behavior
Expected:
The login page should render correctly with Thymeleaf processing.
Actual:
The application enters a redirection loop.
The NoClassDefFoundError for org.unbescape.html.HtmlEscape appears in the logs.
If I remove all Thymeleaf tags from the HTML file, the page loads without styling.
Environment Details:
Spring Boot Version: 3.4.0
Java Version: 21
Thymeleaf Version: 3.1.2.RELEASE
Unbescape Version: 1.1.6.RELEASE
Tomcat Version: 10.1.x (Embedded)
Dependency Management: Maven
Questions:
Is org.unbescape.html.HtmlEscape still used in Thymeleaf 3.x, or has it been replaced?
Should I explicitly include unbescape in my dependencies, or does Thymeleaf 3.x manage it internally?
Is there any Thymeleaf migration step I might have missed when upgrading from 1.5.x to 3.4.x?
Any help or guidance would be greatly appreciated! 🙌
Top comments (0)