springboot在yml配置dataSource后无法启动报错,说第一次启动需要在@SpringBootApplication后加上(exclude = {DataSourceAutoConfiguration.class})
之后又报girlRep in com.example.demo.controller.GirlController required a bean of type ‘com.example.demo.dao.GirlRep’ that could not be found.错误
是因为springboot @Autowired自动注入repository失败,是因为加了(exclude = {DataSourceAutoConfiguration.class})的原因,去掉就OK了