spring报错org.springframework.beans.factory.NoSuchBeanDefinitionException解决办法

spring报错org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.xxx] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
原因: 对应要注入的实现类没有 加注解,如dao层 @Repository 如service层 @Service
解决: 在相应的实现类加上注解即可

你可能感兴趣的:(开发常见问题)