刚创建的 Spring Boot 2.0 项目,启动后输出:
Failed to bind properties under 'spring.datasource.type' to java.lang.Class<javax.sql.DataSource>:
Property: spring.datasource.type
Value: org.apache.tomcat.jdbc.pool.DataSource
Origin: class path resource [application.properties]:5:24
Reason: No converter found capable of converting from type [java.lang.String] to type [java.lang.Class<javax.sql.DataSource>]
Action:
Update your application's configuration
1.5 的项目可以使用
spring.datasource.type=org.apache.tomcat.jdbc.pool.DataSource但2.0 却不行,那就把它删除,默认配置为:
tomcat-jdbc
本文介绍SpringBoot2.0中数据源配置的变化,解释为何无法直接设置spring.datasource.type属性,并提供正确的配置方法。
1740

被折叠的 条评论
为什么被折叠?



