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

`dynamic-datasource-spring-boot3-starter` manual creation of dataSource failed #545

Closed linghengqian closed 1 year ago

linghengqian commented 1 year ago

Please fill it out carefully, or it will be closed. 请认真填写,不然会直接关闭。

Enviroment

JDK Version(required):

SpringBoot Version(required):

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

druid Version(optional):

Describe what happened

Expected Result:

Actual Result:

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

$ ./gradlew clean test

> Task :test
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

AddRemoveDatasourceTest > testAddAndRemoveDataSource() FAILED
    com.baomidou.dynamic.datasource.exception.ErrorCreateDataSourceException at AddRemoveDatasourceTest.java:37
2023-08-11T18:46:07.504+08:00  INFO 6833 --- [ionShutdownHook] c.b.d.d.DynamicRoutingDataSource         : dynamic-datasource start closing ....
2023-08-11T18:46:07.504+08:00  INFO 6833 --- [ionShutdownHook] c.b.d.d.DynamicRoutingDataSource         : dynamic-datasource all closed success,bye

1 test completed, 1 failed

> Task :test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///home/linghengqian/TwinklingLiftWorks/git/public/dynamic-datasource-v413-test/build/reports/tests/test/index.html

* Try:
> Run with --scan to get full insights.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.2.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 4s
4 actionable tasks: 4 executed

Steps to reproduce

git clone git@github.com:linghengqian/dynamic-datasource-v413-test.git cd ./dynamic-datasource-v413-test/ ./gradlew clean test

ZPZP1 commented 1 year ago

这个问题是因为工程环境中不存在HikariDataSource的依赖