配置双数据源后,项目启动报错

Blade 未结 3 5210
llp
llp 剑童 2019-11-11 13:59

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

1. pom文件

    com.baomidou
    dynamic-datasource-spring-boot-starter
    2.4.2

2. yaml文件

截图_20191111135409.png


3.启动类

@EnableScheduling
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})  // 加上exclude和不加同样报错
public class Application {
   public static void main(String[] args) {
      BladeApplication.run(CommonConstant.APPLICATION_NAME, Application.class, args);
   }
}


项目启动时报错:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-11-11 13:57:10.026 ERROR 15748 --- [           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 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).
Disconnected from the target VM, address: '127.0.0.1:62291', transport: 'socket'



3条回答
代码语言
提交回复