【问题标题】:Failed to bind properties under '' to com.zaxxer.hikari无法将 '' 下的属性绑定到 com.zaxxer.hikari
【发布时间】:2019-11-13 13:29:45
【问题描述】:

我正在做 Spring Security,我正在尝试将我的 API 与数据库连接以获取用户身份验证。 我不知道错误。

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource:

    Property: driverclassname
    Value: com.mysql.cj.jdbc.Driver
    Origin: "driverClassName" from property source "source"
    Reason: com.mysql.cj.jdbc.Driver

Action:

Update your application's configuration

Process finished with exit code 1

【问题讨论】:

    标签: java spring spring-security


    【解决方案1】:

    看起来像 HikariCP 配置问题。如果你使用 yml 文件进行 spring boot,application.yml 文件应该有以下内容。

    spring:
      datasource:
        type: com.zaxxer.hikari.HikariDataSource
        url: <jdbc url specific to your database>
        driver-class-name: <database url>
        username: <username>
        password: <password>
        hikari:
          idle-timeout: 10000 
    

    请按照我提到的角度更改占位符 根据数据库。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-17
      • 2018-12-18
      • 1970-01-01
      • 2012-06-15
      • 2020-11-20
      • 2014-03-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多