码迷,mamicode.com
首页 > 编程语言 > 详细

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

时间:2020-01-09 15:55:45      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:org   ini   xxx   整合   根据   描述   tor   xxxxx   ted   

问题描述

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘xxxxx.UserService‘ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

Description: Field userService
in com.atguigu.gmall.user.controller.UserController required a bean of type xxxx.service.UserService that could not be found. Action: Consider defining a bean of type xxxx.service.UserService in your configuration.

 

解决方案 :

  1. 根据报错, 将UserService的注解@Autowired 修改为 @Autowired(required=true)  ===> 无效

  2. 由于整合了dubbo, 修改UserService的注解为@Reference

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

标签:org   ini   xxx   整合   根据   描述   tor   xxxxx   ted   

原文地址:https://www.cnblogs.com/chenxi-mxj/p/12171870.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!