尝试运行 Spring Boot 应用程序时出现以下错误。
Description:
Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource:
Property: driverclassname
Value: oracle.jdbc.OracleDriver
Origin: "driverClassName" from property source "source"
Reason: Unable to set value for property driver-class-name
Action:
Update your application's configuration
这是我遇到的 同样问题,但我没有使用 maven。
我正在使用 spring Boot 2.0.0
和以下启动器。
dependencies {
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.1"
testCompile "org.springframework.boot:spring-boot-starter-test"
}
这是我的 application.properties
文件
spring.datasource.url= *****
spring.datasource.username= ******
spring.datasource.password= ******
原文由 user9735824 发布,翻译遵循 CC BY-SA 4.0 许可协议
正如 Stephane Nicoll 所说,您的类路径中没有驱动程序。您需要在您的 gradle 构建中包含 jdbc 驱动程序,如下所示。但是,您不必坚持我包含的驱动程序版本。