SpringBoot笔记--Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.报错的解决
问题描述
写了SpringBoot代码之后,运行不出来结果,报出这样的一个错误:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
问题解决
在@SpringBootApplication注解后面加上这样一句代码:(exclude= {DataSourceAutoConfiguration.class})
就可以完美解决这一问题啦!
我后续又出现了8080端口被占用的情况,简单,直接在.yml文件里面换一个端口运行就能够解决啦!
问题解决之后:
成功输出想要的结果!!!