分享知识 传递快乐
因为项目需要的原因在 pom.xml 中引入:
<!-- 多数据源 -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
</dependency>
<!-- druid 官方 starter -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
</dependency>
但在项目启动时提示找不数据源,出现以下错误提示:
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 databas

当在SpringBoot项目中引入多数据源和Druid依赖后,启动时出现找不到数据源的错误。原因是SpringBoot自动配置导致。解决办法是在启动类上排除Druid的自动配置类,如`@SpringBootApplication(exclude=DruidDataSourceAutoConfigure.class)`。

8030

被折叠的 条评论
为什么被折叠?



