baomidou / dynamic-datasource

dynamic datasource for springboot 多数据源 动态数据源 主从分离 读写分离 分布式事务
https://www.kancloud.cn/tracy5546/dynamic-datasource/2264611
Apache License 2.0
4.75k stars 1.19k forks source link

从3.6.1升级到4.3后报错实例化了两个dynamicDataSourceProperties #677

Closed sayid closed 1 month ago

sayid commented 1 month ago

Enviroment

JDK Version(required): 11

SpringBoot Version(required): 2.7.18

dynamic-datasource-spring-boot-starter Version(required):4.3.1

druid Version(optional):1.2.23

Describe what happened

从3.6.1升级到4.3.1后启动报错

Expected Result:

Actual Result:

If there is an exception,or aop invalid,please attach the exception trace:

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

Description:

Parameter 0 of constructor in com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAopConfiguration required a single bean, but 2 were found:
    - spring.datasource.dynamic-com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties: defined in unknown location
    - dynamicDataSourceProperties: defined by method 'dynamicDataSourceProperties' in class path resource [com/baomidou/dynamic/datasource/spring/boot/autoconfigure/DynamicDataSourceAopConfiguration.class]

Steps to reproduce