springboot集成dynamic-datasource-spring-boot-starter报错

1、{dataSource-1} init error java.sql.SQLException: url not set at com.alibaba.druid.pool.DruidD.
如果没有使用dynamic,直接把pom依赖删除;
2、SpringBoot - java.lang.RuntimeException: dynamic-datasource Please check the setting of primary

 datasource:
    dynamic:
      primary: master_rt
      datasource:
        master_rt:
          type: com.zaxxer.hikari.HikariDataSource
          driver-class-name: oracle.jdbc.driver.OracleDriver
          url: 
          username: "gamora"
          password: "password"
          minimum-idle: 5
          maximum-pool-size: 15
          connection-test-query: SELECT 1 FROM DUAL
        slave_rt:
          type: com.zaxxer.hikari.HikariDataSource
          driver-class-name: oracle.jdbc.driver.OracleDriver
          url: 
          username: "gamora"
          password: "password"
          minimum-idle: 5
          maximum-pool-size: 15
          connection-test-query: SELECT 1 FROM DUAL

注意一下:master_rt,以这个master开头就没问题了。

你可能感兴趣的:(spring,boot,java,后端)