zoukankan      html  css  js  c++  java
  • 启动项目报错:org.springframework.beans.factory.UnsatisfiedDependencyException

    dubbo项目:

    启动项目报错:(web端)

    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.refile.api.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

    原因:

    一直以为是dubbo端服务没有正常提供接口服务,但发现报错的内容和找不到dubbo接口服务异常内容不一样,所以怀疑不是dubbo提供接口服务问题。

    找了半天发现是web端启动的时候没有扫描到dubbo消费端的配置文件。

    解决办法:

    修改web.xml文件的内容:

    <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:spring/refile-mvc.xml</param-value>
        </context-param>

    改为classpath:spring/*.xml

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:spring/*.xml</param-value>
    </context-param>

    spring监听器:

    <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:spring/refile-mvc.xml</param-value>
        </context-param>
  • 相关阅读:
    洛谷 P2969 [USACO09DEC]音符Music Notes
    洛谷 P2646 数数zzy
    洛谷 P1605 迷宫
    洛谷 P1157 组合的输出
    洛谷 P1449 后缀表达式
    洛谷 P1205 [USACO1.2]方块转换 Transformations
    洛谷 P1599 结算日
    洛谷 P2909 [USACO08OPEN]牛的车Cow Cars
    洛谷 P2118 比例简化
    3.2、spark集群运行应用之第三方jar的处理方式
  • 原文地址:https://www.cnblogs.com/super-chao/p/8467275.html
Copyright © 2011-2022 走看看