BeanNotOfRequiredTypeException: Bean named "" must be of type [] but was actually of type [com.su
来源:互联网 发布:板绘用什么软件 编辑:程序博客网 时间:2024/05/22 13:52
转自:http://blog.csdn.net/u014308482/article/details/53033867
在用junit测试dao接口时,出现以下的错误
Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'userDao' must be of type [com.changetech.dao.impl.UserDaoImpl], but was actually of type [$Proxy16]
最后经过仔细检查,错误原因如下:
@Resource(name="userDao")
protected UserDaoImpl userDao;
public void setUserDao(UserDaoImpl userDao) {
this.userDao = userDao;
}
原来在定义Dao时,没有用接口,而直接使用的是Dao的实现类,改为如下:
@Resource(name="userDao")
protected IUserDao userDao;
public void setUserDao(IUserDao userDao) {
this.userDao = userDao;
}
问题得到了解决
阅读全文
0 0
- BeanNotOfRequiredTypeException: Bean named "" must be of type [] but was actually of type [com.su
- BeanNotOfRequiredTypeException: Bean named "" must be of type [] but was actually of type [com.sun.p
- Bean named '*' must be of type [*], but was actually of type [com.sun.proxy.$Proxy34]
- Bean named 'deptDao' must be of type [com.zttech.sys.dao.IGroupDao], but was actually of type [com.s
- Bean named 'testImpl' must be of type [lcw.serviceimpl.testImpl], but was actually of type [com.sun.
- Bean named 'xxx' must be of type xxx , but was actually of type [com.sun.proxy.$Proxy189]
- “Bean named XXX must be of type[XXX], but was actually of type[XXX]”
- Bean named must be of type , but was actually of type
- Bean named '*' must be of type [*], but was actually of type [*] with root case
- “Bean named XXX must be of type[XXX], but was actually of type[XXX]”
- Bean named 'transactionAdvice' must be of type [org.aopalliance.aop.Advice], but was actually of typ
- Getting Spring Error “Bean named 'x' must be of type [y], but was actually of type [$Proxy]” in Jenk
- Bean named 'userDao' must be of type [cn.itcast.nsfw.user.dao.UserDao], but was actually of type [cn
- Bean named 'BService' is expected to be of type 'path1' but was actually of type 'path2'
- BeanNotOfRequiredTypeException:Bean named 'xxx' must be of type [xxxxx]...
- 解决must be of type [com.bysj.services.CompanyServiceImp], but was actually of type [com.sun.proxy.$Pr
- BeanNotOfRequiredTypeException 异常:but was actually of type 'com.sun.proxy.$Proxy17'
- 使用spring遇到"BeanNotOfRequiredTypeException......but was actually of type [com.sun.proxy.$Proxy18]"异常
- 第11周项目1-图的基本算法库
- xsd配置
- python3.x如何从互联网获取想要的文章,及转化为nltk可以处理的文本
- ubuntu14.04 图形化配置 静态IP
- 由参加领域驱动设计大会与自己所想的
- BeanNotOfRequiredTypeException: Bean named "" must be of type [] but was actually of type [com.su
- 1到n的阶层
- dubbo zookeeper简单的provide 和cosumer
- fedora27 sublime3 fcitx 中文输入 解决
- mongodb遍历万亿级数据,论索引的重要性
- 高可用集群架构maxscale
- CButtonST类使用
- 设计模式(二十五)------23种设计模式(17):享元模式
- spring注解