首页 > 其他分享 >SpringBoot笔记--Failed to configure a DataSource: 'url' attribute is not specified and no em

SpringBoot笔记--Failed to configure a DataSource: 'url' attribute is not specified and no em

时间:2023-01-09 16:55:53浏览次数:48  
标签:SpringBoot embedded no attribute configured Failed 报错 specified configure

问题描述

写了SpringBoot代码之后,运行不出来结果,报出这样的一个错误:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

问题解决

@SpringBootApplication注解后面加上这样一句代码:(exclude= {DataSourceAutoConfiguration.class})

就可以完美解决这一问题啦!

我后续又出现了8080端口被占用的情况,简单,直接在.yml文件里面换一个端口运行就能够解决啦!

问题解决之后:

成功输出想要的结果!!!

标签:SpringBoot,embedded,no,attribute,configured,Failed,报错,specified,configure
From: https://www.cnblogs.com/liuzijin/p/17037455.html

相关文章