Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded
给大家分享常见的解决方案和自己遇到的问题解决的方案
常见的解决方案:
第一种方法是在配置文件中配置数据源
第二种方法是在启动类的注解上添加,@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
我遇到的问题上述两种方法都不能解决,数据源也是配置了,相应的注解中也加@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class}),启动还是会报这个错
后来发现yml中的datasource type中的代码删掉再写的时候没有提示
依赖也是加了的,所以看了下project structure中的moduls,发现resources文件夹没有被识别,添加识别之后就可以正常启动了
yml中的配置文件的代码颜色也变了,说明文件被springBooot识别了