找了俩小时的bug,bug时还是要看报错提示
如图所示:
项目的结构目录:
报错提示:
** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.
Failed to parse configuration class [Application]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/social/config/annotation/SocialConfigurerAdapter.class] cannot be opened because it does not exist
解决办法:
@SpringBootApplication如果这个注解后面不指定扫哪些包,它默认的扫包范围是当前包,及其以下 注意入口类(SpringBootApplication)在项目结构中所在位置:
SpringBootApplication启动类不能直接放在java文件夹下
建个包
问题解决。