zoukankan      html  css  js  c++  java
  • 记录bug:dao自动注入失败

    dao自动注入失败错误的一种奇葩形式

    14:30:49,629 ERROR DispatcherServlet:503 - Context initialization failed
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'checkItemServiceImpl': Unsatisfied dependency expressed through field 'checkItemDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.health.dao.CheckItemDao' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

    这是我的文件结构,这些都是在provider项目中的

    这是运行backend和provider项目时候,backend项目会报错,意思是有个dao自动注入失败了,autowared没有起作用,但是这些dao应该是在provider项目才对,provider项目那边并没有报错。

    仔细查找错误发现,这是backend项目的坐标:

    真相就是:

    在backend中把provider当依赖引入了,backend中有自己本地的一份provider代码参与运行,但是backend里面容器中没有dao的,所以就一直报错dao注入失败

  • 相关阅读:
    6-2 铁轨 uva 514
    并查集基础
    周练7
    周练5
    周练4
    二分查找
    周练3
    2-7 使用不同方式进行定位.py
    2-6 使用title_contains检查页面是否正确
    启用不同浏览器.py
  • 原文地址:https://www.cnblogs.com/maomaodesu/p/12500882.html
Copyright © 2011-2022 走看看