springboot创建项目后运行报错【Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.】

 

 

先说解决办法

 配置属性:

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

 

 

解释原因:

新创建的项目没有配置数据源  所以在项目启动的时候回去查找项目的数据源,但是发现找不到所以报错。

 

 

 

如果配置了数据源之后  就算是没有排除自动配置数据源

 

项目也是可以启动成功的

posted @ 2018-07-11 16:09  dream_on_sakura_rain  阅读(8501)  评论(0编辑  收藏  举报