org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'marketController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.shuabaobao.goods.i.DistributionService org.shuabaobao.manager.controller.MarketController.distributionService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.shuabaobao.goods.i.DistributionService] 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)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
提供者为
<dubbo:service retries="0" interface="org.shuabaobao.users.i.UserService" ref="userService" /> //提供者
此错误一般是消费者没有写好,检查:尤其是interface中的内容
<dubbo:reference id="userService" interface="org.shuabaobao.users.i.UserService" check="false" /> //消费者
控制层上有
@Resource
private ClientService clientService;