首页 > 技术文章 > 奇葩的Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

share-record 2020-01-15 18:42 原文

 

 

 启动springboot的时候莫名其妙出现这个错误,我properties里面也没配置数据源啥的,但就是出现这个错误

解决方法:

在启动类上加@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})

即在@SpringBootApplication上加(exclude= {DataSourceAutoConfiguration.class})

其他因为数据源的问题出现的这个错误网上好多,这里不赘述。

推荐阅读