SpringBoot : 当使用@SpringBootApplication 和 @ComponentScan 注解 导致报错
当只有一个@ComponentScan的时候,SpringBootApplication是不会被加载的,两者共存问题导致报错
解决办法: 使用@ComponentScans({@ComponentScan("包名")}) 代替 @ComponentScan 方可解决
@SpringBootApplication
@ComponentScans({@ComponentScan("包名")})