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

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

解决包冲突
问题:
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:/D:/developTools/apache-maven-3.3.9/localRepository/org/thymeleaf/thymeleaf-spring5/3.0.9.RELEASE/thymeleaf-spring5-3.0.9.RELEASE.jar!/org/thymeleaf/spring5/SpringTemplateEngine.class

The class hierarchy was loaded from the following locations:

org.thymeleaf.spring5.SpringTemplateEngine: file:/D:/developTools/apache-maven-3.3.9/localRepository/org/thymeleaf/thymeleaf-spring5/3.0.9.RELEASE/thymeleaf-spring5-3.0.9.RELEASE.jar
org.thymeleaf.TemplateEngine: file:/D:/developTools/apache-maven-3.3.9/localRepository/org/thymeleaf/thymeleaf/3.0.9.RELEASE/thymeleaf-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

可以这个thymeleaf类可以从两个地方load,这就冲突了

解决方法:
在这里插入图片描述
Correct the classpath of your application so that it contains a single, compatible version of org.th_第1张图片
我把话红线的包删除。

重启,成功
Correct the classpath of your application so that it contains a single, compatible version of org.th_第2张图片

参考链接
https://blog.csdn.net/m0_37783096/article/details/90767755

问题学习spring-boot时因为

你可能感兴趣的:(bug解决,java,boot)