No qualifying bean of type [xxx] found for dependency

阅读: 评论:0

No qualifying bean of type [xxx] found for dependency

No qualifying bean of type [xxx] found for dependency

描述
  • org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘xxx’:Injection of resource dependencies failed
  • org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [xxx] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency
问题来源
  • xml配置文件中没有启用注解功能或者扫描包路径错误
  • xxxServiceImpl实现类没有使用@Service注解
  • xxxService调用错误,出现自己调自己的情况
	<!-- 对所有类进行扫描,以完成Bean创建和自动依赖注入的功能 --><context:component-scan base-package=&#x"/>

//此处没有使用@service
@Service
public class OperatorServiceImpl implements OperatorService {/* 自己调自己@Resourceprivate OperatorService operatorService;*/@Resourceprivate OperatorDao operatorDao;

本文发布于:2024-02-04 05:54:14,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170700443452830.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:bean   qualifying   type   dependency   xxx
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23