Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource Spring Boot

I am getting following error when I try to run spring boot application.

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 

This is same issue I have but i am not using maven.

I am using spring Boot 2.0.0 with following starters.

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" } 

And this is my application.properties file

spring.datasource.url= ***** spring.datasource.username= ****** spring.datasource.password= ****** 
like image 743
user9735824 Avatar asked May 07 '18 13:05

user9735824


1 Answers

Same problem with me (Spring boot 2),

I Fixed add driver-class.

Look up application.properties file.

spring.datasource.driver-class-name=com.mysql.jdbc.Driver 

Full code.

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 
like image 86
bamossza Avatar answered Sep 19 '22 06:09

bamossza