多数据源启动报错 Failed to configure a DataSource: 'url' attribute is not specified

Blade 未结 1 244
hongjl
hongjl 剑圣 2023-04-24 18:40

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

 1.如图:

PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "false");

image.png

2. 在pom文件上面增加多数据源代码

com.baomidoudynamic-datasource-spring-boot-starter3.3.6

image.png

3.在dev.yml文件增加配置

image.png

image.png


4.启动报错

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


image.png

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

多数据源配置之后,能够正常启动和使用


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

<bladex.tool.version>3.0.1.RELEASE</bladex.tool.version>

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

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2023-04-24 18:00:30.684 ERROR 16720 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 


***************************

APPLICATION FAILED TO START

***************************


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


Disconnected from the target VM, address: '127.0.0.1:56391', transport: 'socket'

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

1条回答
提交回复