版权声明:版权声明:本文为博主原创文章,转载时请注明出处——作者:冰怜 https://blog.csdn.net/xiaoxin0630/article/details/87970213
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.xuecheng.manager_cms.dao.CmsPageRepositoryTest': Unsatisfied dependency expressed through field 'cmsPageRepository'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.xuecheng.manage_cms.dao.CmsPageRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
网上的解决的办法,
1.启动类没有创建
2.没有扫描到包
3.没有加上service注解
我这次出现的有点马虎。。测试包下的启动类不能和main的启动类 名字不能一眼。。。。