当前位置:
首页 >
行业知识 >
Spring Boot 项目运行时报错 Error starting ApplicationContext. To display the conditions report re-run your
行业知识
Spring Boot 项目运行时报错 Error starting ApplicationContext. To display the conditions report re-run your
2026-12-05 21:25:34
来源:互联网转载
Spring Boot 项目运行时报错
报错如下:
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
一行的大概意思是:
启动ApplicationContext时出错。要显示条件报告,请在启用“调试”的情况下重新运行您的应用程序。
== 主要看下面的错误 ==
Description:
Failed to bind properties under ‘spring.thymeleaf.servlet’ to org.springframework.boot.autoconfigure.thymeleaf.ThymeleafProperties$Servlet:
Reason: No converter found capable of converting from type [java.lang.String] to type [org.springframework.boot.autoconfigure.thymeleaf.ThymeleafProperties$Servlet]
经过多方面的搜索查找找到的方法
①、配置的的application.yml里面项出错了,注意空格
server: port: 8080spring: thymeleaf: prefix: classpath:/templates/ #模版路径 suffix: .html #模版后缀 servlet: content-type:text/html #设置 Content-type encoding: UTF-8 #编码方式 mode: HTML5 #校验 H5格式 cache: false #关闭缓存,在开发过程中可以立即看到页面修改的结果
.yml文件中的content-type:text/html冒号中间没有用空格导致出错,颜色也不对。
②、application.properties文件里面项出错了
#连接数据库 8 #serverTimezone=GMT%2B8:spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driverspring.datasource.url=jdbc:mysql://localhost:3306/mybatis_plus?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8spring.datasource.username=rootspring.datasource.password=123456
每一项的后面是使用**=**连接
下次遇到不要在无脑找半天错了
下一篇:服务器受到摧毁怎么办?