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

Springboot中关于多数据源启动信息提示对象被提前初始化 #458

Closed xztitcast closed 1 year ago

xztitcast commented 2 years ago

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

Spring boot版本2.7.5 dynamic-datasource-spring-boot-starter 版本3.5.2

该问题是如何引起的?(确定最新版也有问题再提!!!)

项目启动提示信息

重现步骤(如果有就写完整)

1.新建一个Spring Boot2.7.5版本的demo工程 2.依赖dynamic-datasource-spring-boot-starter、mybatis-plus-boot-starter、spring-boot-starter-web 3.配置好多数据源 spring: datasource: dynamic: hikari: min-idle: 1 max-pool-size: 4 idle-timeout: 600000 max-lifetime: 1800000 is-auto-commit: true validation-timeout: 3000 connection-timeout: 30000 connection-test-query: SELECT 1 primary: master datasource: master: url: jdbc:mysql://192.168.25.100:3306/smart_oss?allowMultiQueries=true&useUnicode=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai username: eden password: jiushi123 driver-class-name: com.mysql.cj.jdbc.Driver type: com.zaxxer.hikari.HikariDataSource '[core_master]': url: jdbc:mysql://192.168.25.100:3306/smart_core?allowMultiQueries=true&useUnicode=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai username: eden password: jiushi123 driver-class-name: com.mysql.cj.jdbc.Driver type: com.zaxxer.hikari.HikariDataSource '[os_master]': url: jdbc:mysql://192.168.25.100:3306/smart_openstack?allowMultiQueries=true&useUnicode=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai username: eden password: jiushi123 driver-class-name: com.mysql.cj.jdbc.Driver type: com.zaxxer.hikari.HikariDataSource 4.正常启动即可看到该提示信息

报错信息

该信息并不是错误信息只是在项目中启动提示的INFO信息 Bean 'spring.datasource.dynamic-com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties' of type [com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) Bean 'com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration' of type [com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration$$EnhancerBySpringCGLIB$$31fe8107] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) Bean 'dsProcessor' of type [com.baomidou.dynamic.datasource.processor.DsHeaderProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

huayanYu commented 2 years ago

无法复现啊

aStudyMachine commented 5 months ago

同样的报错 , spring boot 版本 3.2.4 ds-spring-boot3-starter 版本 4.3.0

aStudyMachine commented 5 months ago

同样的报错 , spring boot 版本 3.2.4 ds-spring-boot3-starter 版本 4.3.0

补充 启动报错warning 信息 Bean 'com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAopConfiguration' of type [com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAopConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [healthEndpointGroupsBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.