环境:eclipse 2018 12版本
原因是其他的类与主程序类不在同一个包中,springboot扫描不到
解决办法:在主程序上加上注解@ComponentScan(basePackages="xxx.xxx")
其中xxx.xxx为包名
如果把ComponentScan注释掉,就会报错
转载地址
spring boot测试报org.springframework.beans.factory.NoSuchBeanDefinitionException错误
猜你喜欢
转载自blog.csdn.net/weixin_43763175/article/details/90318867
今日推荐
周排行