org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'XXX': Unsatisfied dependency expressed through field 'XXX'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.custom.interfaces.XxxService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

解决思路:
1、网络找到的答案都是说没有贴 @Service注解或者是 @Autowired
2、如果你存在使用的包是POM.xml文件引用的情况下,需要去留意你所引用的包有版本有没有更新。因为旧的引用包中找不到新编写的服务,导致无法创建Bean的现象。修改POM的版本即可。
3、远程服务的调用(使用的是dubbo),可以把注解 @Autowired 改为 @Reference

踩坑记录希望可以帮到大家~


Lougacen_Jc
7 声望0 粉丝