运行项目时,提示错误:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'databaseController': Injection of autowired dependencies failed;
nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.baosight.rds.kubernetes.RestDao com.baosight.rds.kubernetes.DatabaseController.dao;
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.baosight.rds.kubernetes.RestDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
 
这段错误的大致含义就是:
创建name为databaseController的bean时失败了。因为找不到自动注入的变量:DatabaseController.dao。
因为这个名为dao的变量,类名是RestDao,但是在RestDao里却找不到一个自动注入的qualifies(比如@Service,@Component,@Repository,@Controller这种)。
所以要解决这个问题,就是检查RestDao类,看自己到底遗漏了哪个qualifies。
 
检查后,发现RestDao没有加@Repository。
 
 
 

2016.11.4 Injection of autowired dependencies failed的更多相关文章

  1. eclipse 启动tomcat报Spring错误 Error creating bean with name 'serviceOrderBiz': Injection of autowired dependencies failed

    启动tomcat报异常,提示Sring无法创建serviceOrderBiz(第一行红字),继续看是因为有一个自动注入的字段无法注入ModuleInterfaceBiz(第二行红字),检查servic ...

  2. Failed to load ApplicationContext ,Error creating bean with name 'adminUserService': Injection of autowired dependencies failed;

    Druid配置的时候出现这个问题: "C:\Program Files\Java\jdk1.8.0_191\bin\java" -ea -Didea.test.cyclic.buf ...

  3. IDEA报错: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.datasource.url' in value "${spring.datasource.url}"

    运行审核流模块: 在ActivitiServiceApplication模块日志报错: Error starting ApplicationContext. To display the auto-c ...

  4. Error creating bean with name 'signController': Injection of autowired dependencies failed

    出现了一大串错误,Error creating bean with name 'signController': Injection of autowired dependencies failed. ...

  5. 异常:Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException

    这个异常是出现在注入配置文件中配置好的属性时报错的: Injection of autowired dependencies failed; nested exception is java.lang ...

  6. Injection of autowired dependencies failed

    error:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mainCo ...

  7. tomcat启动报错:Injection of autowired dependencies failed

    tomcat启动报错:Injectjion of autowired dependencies failed 环境: 操作系统:centos6.5 tomcat: 7.0.52 jdk:openjdk ...

  8. Error creating bean with name 'adminUserController': Injection of autowired dependencies failed;

    spring 个坑爹地,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ...

  9. tomcat启动报错:Injection of autowired dependencies failed

    Error creating bean with name 'backPrintPaperController': Injection of autowired dependencies failed ...

随机推荐

  1. Leetcode 561.数组拆分I

    数组拆分 I 给定长度为 2n 的数组, 你的任务是将这些数分成 n 对, 例如 (a1, b1), (a2, b2), ..., (an, bn) ,使得从1 到 n 的 min(ai, bi) 总 ...

  2. c++ primer 读书笔记

    顺序容器:为程序提供控制元素存储和访问顺序的能力,这种顺序与元素加入到容器时的位置相对应,而与元素值无关. 另外还有根据关键字的值来存储元素的容器:有序.无序关联容器. 另外STL还有三种容器适配器, ...

  3. rsync 使用小记

    工作中遇到了有关rsync使用的问题,在这里记录下供有同样需求的人参考一下 先说下环境 服务端配置 pid file = /rsyncdata/rsyncd.pid port = 873 addres ...

  4. web自动化测试:watir+minitest(一)

    基本介绍: 本课程的测试环境和工具为:win7+ruby+watir+minitest Watir 全称是"Web Application Testing in Ruby".它是一 ...

  5. 用日志记录Linux用户执行的每一条命令(history)

    工作中,需要把用户执行的每一个命令都记录下来,并发送到日志服务器的需求,为此我做了一个简单的解决方案.这个方案会在每个用户退出登录 时把用户所执行的每一个命令都发送给日志守护进程rsyslogd,你也 ...

  6. post方式的数据抓取

    public static String sendPost(String url, String param) {        PrintWriter out = null;        Buff ...

  7. Apache+Openssl

    Apache编译还需要一些依赖: #./configure --prefix……检查编辑环境时出现: checking for APR... no configure: error: APR not ...

  8. react之只用classNames避免字符串拼接

    之前在react当中使用了字符串拼接的方式来拼接类名的字符串,这种方法不仅不够方便,还会出现很多问题 使用classNames这个工具,可以省去拼接字符串的烦恼,大大提高开发效率 首先,最简单的使用方 ...

  9. iOS多线程:『GCD』详尽总结 ---(转)

    文章:https://bujige.net/blog/iOS-Complete-learning-GCD.html 文中 Demo 我已放在了 Github 上,Demo 链接:https://git ...

  10. 【HDOJ5981】Guess the number(DP)

    题意:A和B玩一个游戏:A在[L,R]之间随机选取一个数X,之后由B来猜这个数, 如果猜的数比X小,则A就告诉B你猜的数小了, 如果猜的数等于X则游戏结束, 如果猜的数大于X,则在这之后A只会回答B是 ...