Failed to bind properties under ‘‘ to com.zaxxer.hikari.HikariDataSource:
问题描述:springboot启动时遇到错误:Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2021-10-09 16:10:19.148 ERROR 3668 --- [main] o.s.b.d.LoggingFai
·
问题描述:
springboot启动时遇到错误:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-10-09 16:10:19.148 ERROR 3668 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource:
Property: driver-class-name
Value: com.mysql.cj.jdbc.Driver
Origin: "driverClassName" from property source "source"
Reason: java.lang.RuntimeException: Failed to load driver class com.mysql.cj.jdbc.Driver in either of HikariConfig class loader or Thread context classloader
Action:
Update your application's configuration
原因分析:
springBoot作测试的时候默认的是h2数据库 而我用的是mysql所以需要在 application.properties中指定一下
解决方案:
在 application.properties中指定一下
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
更多推荐
已为社区贡献3条内容
所有评论(0)