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

Failed to determine a suitable driver class #512

Closed RuiqianZhang closed 1 year ago

RuiqianZhang commented 1 year ago

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

Enviroment

JDK Version(required): JDK17

SpringBoot Version(required): 3.0.4

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

druid Version(optional):1.2.16

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

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

Action:

Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (the profiles dev are currently active).

Just paste your stack trace here!
zxuanhong commented 1 year ago
  1. I do the same, using 4.0.0.
  2. normal when not in use dynamic-datasource-spring-boot-starter
  3. normal when in use dynamic-datasource-spring-boot-starter 3.6.0
huayanYu commented 1 year ago

https://github.com/dynamic-datasource/dynamic-datasource-samples/tree/master/datasource-samples/druid-sample

@zxuanhong @RuiqianZhang can u Reproduction on this sample ?

zxuanhong commented 1 year ago

@huayanYu The package is wrong, and dynamic-datasource-spring-boot-starter is used.The use of dynamic-datasource-spring-boot3-starter is now normal

huayanYu commented 1 year ago

yes if you are use sb3+ , now you must use dynamic-datasource-spring-boot3-starter