当我试图运行spring引导应用程序时,我会得到以下错误。
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这是我拥有的same issue,但我不使用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= ******发布于 2018-05-08 21:10:58
正如Stephane Nicoll所说,您的类路径上没有司机。您需要在您的gradle构建中包括jdbc驱动程序,如下所示。但是,您不必坚持我已经包含的驱动程序版本。
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"
runtime('com.oracle:ojdbc7:12.1.0.2.0')
}发布于 2018-11-21 14:29:47
我也有同样的问题(Spring 2)
我修正了增加司机级的问题。
查找application.properties文件。
spring.datasource.driver-class-name=com.mysql.jdbc.Driver全部密码。
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=upate
spring.datasource.url=jdbc:mysql://localhost:3306/database_name
spring.datasource.username=admin
spring.datasource.password=admin1234发布于 2019-07-11 08:24:18
当从Spring 2.0.6更新到Spring 2.1.6时,我也犯了同样的错误。
在spring.datasource.driver-class-name=com.mysql.jdbc.Driver中显式设置驱动程序类名application.properties解决了这个问题。
https://stackoverflow.com/questions/50215936
复制相似问题