• org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'xxx' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations:


    问题:
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.jeecgframework.web.system.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    No qualifying bean of type 'org.jeecgframework.web.system.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

    配置:
    spring-mvc-crm.xml
    <context:component-scan base-package="com.jeecg.crm" >
    spring-mvc-aop.xml
    <context:component-scan base-package="org.jeecgframework.core.interceptors" />
    spring-mvc-context.xml
    <context:component-scan base-package="org.jeecgframework.core.aop" />
    spring-mvc-hibernate.xml (7 matches)
    <context:component-scan base-package="org.jeecgframework.easypoi." />
    <context:component-scan base-package="org.jeecgframework.core.common.dao.
    " />
    <context:component-scan base-package="org.jeecgframework.core.common.service." />
    <context:component-scan base-package="org.jeecgframework.jwt.service.
    "/>
    <context:component-scan base-package="com.jeecg.">
    <context:component-scan base-package="org.jeecgframework.web.
    ">
    <context:component-scan base-package="com.zgg.">
    spring-mvc-timeTask.xml
    <context:component-scan base-package="org.jeecgframework.core.timer" />
    spring-mvc.xml (2 matches)
    <context:component-scan base-package="org.jeecgframework.web.
    ,com.jeecg.,org.jeecgframework.jwt.,com.jeecg.crm.controller.,com.zgg.">
    <context:component-scan base-package="springfox"/>

    spring-mvc-crm.xml
    <context:component-scan base-package="com.jeecg.crm" >
    spring-mvc-aop.xml
    <context:component-scan base-package="org.jeecgframework.core.interceptors" />
    spring-mvc-context.xml
    <context:component-scan base-package="org.jeecgframework.core.aop" />
    spring-mvc-hibernate.xml (7 matches)
    <context:component-scan base-package="org.jeecgframework.easypoi." />
    <context:component-scan base-package="org.jeecgframework.core.common.dao.
    " />
    <context:component-scan base-package="org.jeecgframework.core.common.service." />
    <context:component-scan base-package="org.jeecgframework.jwt.service.
    "/>
    <context:component-scan base-package="com.jeecg.">
    <context:component-scan base-package="org.jeecgframework.web.
    ">
    <context:component-scan base-package="com.zgg.">
    spring-mvc-timeTask.xml
    <context:component-scan base-package="org.jeecgframework.core.timer" />
    spring-mvc.xml (2 matches)
    <context:component-scan base-package="org.jeecgframework.web.
    ,com.jeecg.,org.jeecgframework.jwt.,com.jeecg.crm.controller.,com.zgg.">
    <context:component-scan base-package="springfox"/>

    <context:component-scan base-package="org.jeecgframework.core.interceptors" />
    <context:component-scan base-package="org.jeecgframework.core.aop" />
    <context:component-scan base-package="org.jeecgframework.core.common.dao." />
    <context:component-scan base-package="org.jeecgframework.core.common.service.
    " />
    <context:component-scan base-package="org.jeecgframework.core.timer" />
    <context:component-scan base-package="org.jeecgframework.easypoi." />
    <context:component-scan base-package="org.jeecgframework.jwt.service.
    "/>
    <context:component-scan base-package="org.jeecgframework.web.">
    <context:component-scan base-package="org.jeecgframework.web.
    ,org.jeecgframework.jwt.,com.jeecg.crm.controller.,com.zgg.">
    <context:component-scan base-package="com.jeecg.
    ">
    <context:component-scan base-package="com.jeecg.crm" >
    <context:component-scan base-package="com.zgg.*">
    <context:component-scan base-package="springfox" />

    <context:component-scan base-package="org.jeecgframework.core.,org.jeecgframework.easypoi.,org.jeecgframework.jwt.,org.jeecgframework.web.,com.jeecg.,com.jeecg.crm,com.jeecg.crm.controller.,com.zgg.*,springfox" />

    方案:@ComponentScan("org.jeecgframework.core.,org.jeecgframework.easypoi.,org.jeecgframework.jwt.,org.jeecgframework.web.,com.jeecg.,com.jeecg.crm,com.jeecg.crm.controller.,com.zgg.*,springfox")
    @SpringBootApplication
    public class Application {
    public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
    }
    }

  • 相关阅读:
    CF1168B Good Triple 性质分析
    bzoj 4994: [Usaco2017 Feb]Why Did the Cow Cross the Road III 树状数组_排序
    BZOJ 3940: [Usaco2015 Feb]Censoring AC自动机+栈
    BZOJ 1691 [Usaco2007 Dec]挑剔的美食家 multiset+排序+贪心
    BZOJ 1725: [Usaco2006 Nov]Corn Fields牧场的安排 状压动归
    BZOJ 1726: [Usaco2006 Nov]Roadblocks第二短路 Dijkstra
    BZOJ 1666: [Usaco2006 Oct]Another Cow Number Game 奶牛的数字游戏 幼儿园测试题
    BZOJ 5508: [Tjoi2019]甲苯先生的字符串 矩阵乘法_思维
    BZOJ 1602: [Usaco2008 Oct]牧场行走 倍增裸题
    描述符get/set/delete,init/new/call,元类
  • 原文地址:https://www.cnblogs.com/rgqancy/p/12765765.html
Copyright © 2020-2023  润新知