maven - Spring Boot 3.4 Thymeleaf NoClassDefFoundError for org.unbescape.html.HtmlEscape after Upgrade - Stack Overflow

I recently upgraded a Spring Boot application from 1.5.7 to 3.4.x and Java from 8 to 21. After the upgr

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: /unbescape/html/HtmlEscape]
 
Caused by: java.lang.ClassNotFoundException: .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:

<dependency>
<groupId>.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
 
<dependency>
<groupId>.unbescape</groupId>
<artifactId>unbescape</artifactId>
<version>1.1.6.RELEASE</version>
</dependency>

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 .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 .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!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744401381a4572404.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信