一、该问题的重现步骤是什么?
1. pom文件
com.baomidou
dynamic-datasource-spring-boot-starter
2.4.2
2. yaml文件
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'
扫一扫访问 Blade技术社区 移动端