错误500:org / unbescape / html / HtmlEscape-尝试到达端点时(使用百里香模板)

时间:2019-01-15 01:07:15

标签: java rest maven spring-boot thymeleaf

我正在Maven 4中从事Spring Boot 2.1.1项目的工作。 Error (type=Internal Server Error, status=500) org/unbescape/html/HtmlEscape尝试到达控制器中定义的任何端点时。我有百里香作为模板引擎。

pom.xml Thymeleaf依赖

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

当我尝试到达“ /”(发生在任何端点)时,从eclipse控制台记录日志:

INFO 1936 --- [nio-8080-exec-2] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
INFO 1936 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
INFO 1936 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Completed initialization in 17 ms
ERROR 1936 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/unbescape/html/HtmlEscape] with root cause`

java.lang.ClassNotFoundException: org.unbescape.html.HtmlEscape

    at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_121]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_121]
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[na:1.8.0_121]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_121]
    at org.thymeleaf.util.EscapedAttributeUtils.unescapeAttribute(EscapedAttributeUtils.java:103) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]
    at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess(AbstractAttributeTagProcessor.java:72) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]
    at org.thymeleaf.processor.element.AbstractElementTagProcessor.process(AbstractElementTagProcessor.java:95) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]
    at org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process(ProcessorConfigurationUtils.java:633) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]
    at org.thymeleaf.engine.ProcessorTemplateHandler.handleOpenElement(ProcessorTemplateHandler.java:1314) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]
    at org.thymeleaf.engine.OpenElementTag.beHandled(OpenElementTag.java:205) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]
    at org.thymeleaf.engine.TemplateModel.process(TemplateModel.java:136) ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]

列表继续。我正在寻求您的帮助,谢谢您。

0 个答案:

没有答案