Injection of resource dependencies failed解决办法总结
今天调试项目代码,出现的引resource的报错,查原因查了好长时间才找到,现在这里总结一下,以免以后忘掉以及给大家参考。
报错大致内容入下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customBlackListService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.wondershare.router.dao.CustomBlackListDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER)}
找不到依赖的dao,什么原因,spring3 自动注解的,为什么找不到?
找了很多资料,常见的有下面这个:
1、beans 的xml里面没有配置 
<context:component-scan base-package="package-name"/>
2、第二种情况(调用死循环)
很遗憾,我的不是这个问题,我的问题是dao的调用出现死循环,即XyyyyDao实现里面,调用了他接口的本身方法:
@Repository
public class ADaoImpl extends BaseDaoImpl implements ADao { @Resource
private ADao aDao; @Override
public int addInbox(TInbox inbox) {
....
......
aDao.delete(id);
}
@Override
public int delete(Long id) {
.....
}
}
导致,加载ADaoImpl需要先加载完ADao,而ADao却还没有加载!
Injection of resource dependencies failed解决办法总结的更多相关文章
- 【解决方案】 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userHandler': Injection of resource dependencies failed;
		一个错误会浪费好多青春绳命 鉴于此,为了不让大家也走弯路,分享解决方案. [错误代码提示] StandardWrapper.Throwableorg.springframework.beans.fac ... 
- Error creating bean with name 'testController': Injection of resource dependencies failed;
		启动ssm项目报错: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 't ... 
- Java报错:Error creating bean with name 'testController': Injection of resource dependencies failed
		报错如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testCo ... 
- Java报错:Injection of resource dependencies failed
		在学习springMVC+Mabatis的时候,添加注解@Resource报错 Injection of resource dependencies failed de完bug后发现有几个点注意一下, ... 
- Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fundService': Injection of resource dependencies failed;
		在进行SSM的Controller的编写, 从浏览器访问后端Controller的时候遇到了这个问题. 这个问题的描述: 创建Bean的对象失败 错误代码如下: @Service("fund ... 
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'supplierAction': Injection of resource dependencies failed; nested exception is org.springframework.beans.factor
		这个错误是因为抽象Action类的时候,把ServletContext写成了serverContext,导致无法注入,正确写法是 import javax.annotation.Resource; i ... 
- 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 ... 
- 异常:Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException
		这个异常是出现在注入配置文件中配置好的属性时报错的: Injection of autowired dependencies failed; nested exception is java.lang ... 
- Injection of autowired dependencies failed
		error:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mainCo ... 
随机推荐
- git+jenkins持续集成一:git上传代码
			先注册一个账号,注册地址:https://github.com/ 记住地址 下载git本地客户端,下载地址:https://git-scm.com/download/win 一路next傻瓜安装,加入 ... 
- 编写高性能React组件-传值篇
			很多人在写React组件的时候没有太在意React组件的性能,使得React做了很多不必要的render,现在我就说说该怎么来编写搞性能的React组件. 首先我们来看一下下面两个组件 import ... 
- [19/02/23]ToolsShare 工具分享 VPNTethering Android (Root Required)
			To be short, VPN Tethering is a quite useful tool when you want to share your private network with s ... 
- Leetcode 493.翻转对
			翻转对 给定一个数组 nums ,如果 i < j 且 nums[i] > 2*nums[j] 我们就将 (i, j) 称作一个重要翻转对. 你需要返回给定数组中的重要翻转对的数量. 示例 ... 
- jquery使用ajax传内容到asp.net乱码解决【转】
			转自:http://www.cnblogs.com/qiantuwuliang/archive/2009/08/02/1537160.html#undefined Jquery强大的功能越来越收到广大 ... 
- nodejs、yarn编译安装
			yarn和npm一样,是nodejs的一个依赖管理工具 1.安装nodejs 如果缺少c++ compiler 会报错 yum install -y gcc gcc-c++ 安装nodejs V8 ... 
- Spring AOP Example 文件下载:
			文件下载:http://files.cnblogs.com/wucg/spring_aop_excise.zip P:124 spring核心技术 P225: spring doc 可以把Advi ... 
- git filter-branch应用
			1.修改author和committer git filter-branch --commit-filter ' export GIT_AUTHOR_EMAIL=me@example.com; exp ... 
- Codeforces Round #316 (Div. 2) B 贪心
			B. Simple Game time limit per test 1 second memory limit per test 256 megabytes input standard input ... 
- python3的cookielib
			http://stackoverflow.com/questions/8405096/python-3-2-cookielib 
