无法将''下的属性绑定到com.zaxxer.hikari.HikariDataSource Spring Boot [英] Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource Spring Boot

查看:303
本文介绍了无法将''下的属性绑定到com.zaxxer.hikari.HikariDataSource Spring Boot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试运行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

这是相同的问题我有,但我没有使用Maven.

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

我正在将spring Boot 2.0.0与以下启动器一起使用.

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

这是我的application.properties文件

spring.datasource.url= *****
spring.datasource.username= ******
spring.datasource.password= ******

推荐答案

正如 Stephane Nicoll 所说,你不知道您的类路径上没有驱动程序.您需要在gradle构建中包括jdbc驱动程序,如下所示.但是,您不必坚持我提供的驱动程序版本.

As Stephane Nicoll said, you don't have driver on your classpath. You need to include jdbc driver on your gradle build as below. However, you don't have to stick to driver version that I have included.

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') 
}

这篇关于无法将''下的属性绑定到com.zaxxer.hikari.HikariDataSource Spring Boot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆