使用dynamic-datasource配置多数据源无效问题

Blade 未结 1 502
gongjie
gongjie 剑童 2023-08-25 15:20

一、该问题的重现步骤是什么?

1. 启动项目


二、你期待的结果是什么?实际看到的又是什么?

成功启动项目并使用多个数据源查询。实际在启动时报错


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

BladeX3.1.0.RELEASE,在本地windows的idea中


四、请提供详细的错误堆栈信息,这很重要。

Description:

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

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).


五、若有更多详细信息,请在下面提供。

以下图片为我当前配置,是根据bladex-biz的blade-demo模块的配置写的:
1692947902604.png


找过的相关问题中提供了方法在启动类上增加注解:@SpringBootApplication(exclude = DruidDataSourceAutoConfigure.class)但是没有效果:
1692947968519.png


1条回答
提交回复