SpringBoot整合Thymeleaf报错:Correct the classpath of your application so that it contains a single, comp

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2020-12-06 12:37:45.664 ERROR 13496 — [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$ThymeleafDefaultConfiguration.templateEngine(ThymeleafAutoConfiguration.java:142)

The following method did not exist:

org.thymeleaf.spring5.SpringTemplateEngine.setRenderHiddenMarkersBeforeCheckboxes(Z)V

The method’s class, org.thymeleaf.spring5.SpringTemplateEngine, is available from the following locations:

jar:file:/F:/develop/maven/m2/repository/org/thymeleaf/thymeleaf-spring5/3.0.9.RELEASE/thymeleaf-spring5-3.0.9.RELEASE.jar!/org/thymeleaf/spring5/SpringTemplateEngine.class

It was loaded from the following location:

file:/F:/develop/maven/m2/repository/org/thymeleaf/thymeleaf-spring5/3.0.9.RELEASE/thymeleaf-spring5-3.0.9.RELEASE.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of org.thymeleaf.spring5.SpringTemplateEngine

Process finished with exit code 1

刚开始毫无头绪,找了很多解决方案,这个错误还是解决不了,后来知道了在pom.xml文件里的的错误了,版本配错了,我Thymeleaf用的是3.0.9.RELEASE的版本 支持程序用的是2.2.2的版本。但是也报错。
<thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>

解决方案
<thymeleaf.version>3.0.11.RELEASE</thymeleaf.version>
直接运行成功
附我的idea版本是2019版本的

上一篇:ECON 312 Fall


下一篇:Mysql考试整理