当前使用版本(必须填写清楚,否则不予处理)

版本见下面配置 com.baomidou mybatis-plus-boot-starter 3.3.1 com.baomidou dynamic-datasource-spring-boot-starter 3.0.0

该问题是怎么引起的?(最新版上已修复的会直接close掉)

下面是数据源配置

spring:
#  datasource:
#    type: com.alibaba.druid.pool.DruidDataSource
#    url: jdbc:postgresql://pgm-2ze6364k8g8h92awvo.pg.rds.aliyuncs.com:1433/video
#    username: test_pg
#    password: OxpE3w8TLGEOEzEy
#    driver-class-name: org.postgresql.Driver
#  application:
#    name: cloud-nacos-discovery-server
#  cloud:
#    nacos:
#      discovery:
#        server-addr: 39.105.164.35:8091
  datasource:
    dynamic:
      primary: my
      datasource:
        my:
#          type: com.alibaba.druid.pool.DruidDataSource
          username: postgres
          password: root
          driver-class-name: org.postgresql.Driver
          url: jdbc:postgresql://127.0.0.1:5432/public
        pg:
#          type: com.alibaba.druid.pool.DruidDataSource
          username: xxx
          password: xxx
          driver-class-name: org.postgresql.Driver
          url: jdbc:postgresql://xxx:1433/video

重现步骤

就是 postgresql 双数据源配置不起来。希望解决一下!

报错信息

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceAutoConfigure.class]: Invocation of init method failed; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class

Comment From: miemieYaho

去 dynamic-datasource-spring-boot-starter 那提