springboot 出现org.springframework.beans.factory.UnsatisfiedDependencyException

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的启动类 名字不能一眼。。。。

你可能感兴趣的:(解决问题)