Debug - SpringBoot - Error starting ApplicationContext. To display the auto-configuration report re-
Posted frank_cui
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Debug - SpringBoot - Error starting ApplicationContext. To display the auto-configuration report re-相关的知识,希望对你有一定的参考价值。
Error log
2019-12-07 22:33:03.959 ERROR 3760 --- [ 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
Solution
在SpringBootApplication后加(exclude=DataSourceAutoConfiguration.class),原因是加载了数据库依赖而没有写配置文件
/** * starter of spring boot */ @SpringBootApplication(exclude=DataSourceAutoConfiguration.class) public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
以上是关于Debug - SpringBoot - Error starting ApplicationContext. To display the auto-configuration report re-的主要内容,如果未能解决你的问题,请参考以下文章