問題描述
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