카테고리 없음

[MariaDB] java.lang.IllegalArgumentException: jdbcUrl is required with driverClassName.

배발자 2023. 1. 17.
반응형

 

java.lang.IllegalArgumentException: jdbcUrl is required with driverClassName. at com.zaxxer.hikari.HikariConfig.validate(HikariConfig.java:1025) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:109) ~[HikariCP-4.0.3.jar:na] at com.p6spy.engine.spy.P6DataSource.getConnection(P6DataSource.java:300) ~[p6spy-3.9.0.jar:na] at org.springframework.jdbc.datasource.DelegatingDataSource.getConnection(DelegatingDataSource.java:99) ~[spring-jdbc-5.3.24.jar:5.3.24] at org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource.getConnection(AbstractRoutingDataSource.java:194) ~[spring-jdbc-5.3.24.jar:5.3.24] at com.p6spy.engine.spy.P6DataSource.getConnection(P6DataSource.java:300) ~[p6spy-3.9.0.jar:na]

 

이유와 해결방법은 아래와 같다. 

 

The configuration mismatch can be resolved by correcting the property name according to the Hikari database driver. The spring boot database url “spring.datasource.url” should be changed to “spring.datasource.jdbc-url"

 

    master:
      hikari:
        username: root
        password: ****
        driverClassName: org.mariadb.jdbc.Driver
        url: jdbc:mariadb://localhost:3306/master?serverTimezone=UTC&characterEncoding=UTF-8
    slave:
      hikari:
        username: root
        password: ****
        driverClassName: org.mariadb.jdbc.Driver
        url: jdbc:mariadb://localhost:3306/slave?serverTimezone=UTC&characterEncoding=UTF-8

 

현재 url : jdbc:mariadb ~ 

이렇게 설정되어있는데 해결방법을 보니 아래와 같이 수정해야 한다. 

 

 

url -> jdbc-url

 

 

master:
  hikari:
    username: root
    password: ****
    driverClassName: org.mariadb.jdbc.Driver
    jdbc-url: jdbc:mariadb://localhost:3306/master?serverTimezone=UTC&characterEncoding=UTF-8
slave:
  hikari:
    username: root
    password: ****
    driverClassName: org.mariadb.jdbc.Driver
    jdbc-url: jdbc:mariadb://localhost:3306/slave?serverTimezone=UTC&characterEncoding=UTF-8

 

반응형

댓글