zoukankan      html  css  js  c++  java
  • org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

    问题描述

    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

  • 相关阅读:
    洛谷P1865 A%B Problem
    树状数组的操作
    树状数组的基础知识
    卡常优化中最为奇怪的操作
    inline的用法
    快速读入的方法
    P1059 明明的随机数及unique去重的用法
    P3376 网络最大流 【模板】
    Gym
    HDU
  • 原文地址:https://www.cnblogs.com/chenxi-mxj/p/12171870.html
Copyright © 2011-2022 走看看