`

Bean named '*' must be of type [*], but was actually of type [$Proxy16]

 
阅读更多

在用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;

}

问题得到了解决

分享到:
评论
1 楼 yulianyu 2013-11-27  
<aop:aspectj-autoproxy proxy-target-class="true"/>
自动代理的参数加入代理cglib的

相关推荐

    Named pipe tcp proxy.zip

    Named Pipe TCP Proxy 终端控制台与模拟器连接: 串口重定向工具,在vmware ORACLE VirtualBox等模拟器下使用。 作为虚拟机之间的管理桥梁,很多时候还能非常有帮助的。

    named pipe tcp proxy

    named pipe tcp proxy

    Named Pipe TCP Proxy.rar

    Named Pipe TCP Proxy 终端控制台与模拟器连接,串口重定向工具,在vmware ORACLE VirtualBox等模拟器下使用 作为虚拟机之间的管理桥梁,很多时候还能非常有帮助的

    Java动态代理内存中生成的$Proxy0类

    Java动态代理内存中生成的$Proxy0类

    Named Pipe TCP Proxy

    会把输入输出重定向到com口,也就是serial上

    java.lang.NoSuchMethodException: com.sun.proxy.$Proxy58.list错误解决办法

    主要介绍了java.lang.NoSuchMethodException: com.sun.proxy.$Proxy58.list错误解决办法的相关资料,需要的朋友可以参考下

    tftp_proxy源码

    Tftp ProxyServer 代理服务器 源码 *=========================================================================== * * Project: tftp_proxy, a proxy for TFTP transfers through firewalls * File: tftp_...

    Python中super()函数简介及用法分享

    Return a **proxy object** that delegates method calls to a **parent or sibling** class of type. 返回一个代理对象, 这个对象负责将方法调用分配给第一个参数的一个父类或者同辈的类去完成. parent or sibling...

    f5 BIGIP V9 Full Proxy定义_WhatdoesFullProxyMean

    We way we’re more of a fully proxy but what does that mean and is it important to the customer? The line of what is and isn’t a proxy are being blurred. We need to clarify these differences and ...

    PHP代理脚本php-proxy.zip

    use Proxy\Proxy; $request = Request::createFromGlobals(); $proxy = new Proxy(); $proxy-&gt;getEventDispatcher()-&gt;addListener('request.before_send', function($event){  $event['request']-&gt;headers-&gt;...

    proxychains-ng-4.14.tar.xz

    * Different proxy types can be mixed in the same chain. * Proxy chain: user-defined list of proxies chained together. Usability : * Run any program through proxy server. * Access the Internet ...

    16-Proxy.rar

    Proxy.rarProxy.rarProxy.rarProxy.rarProxy.rarProxy.rar代理设计模式

    foxyproxy_standard

    FoxyProxy 是一款高级代理服务器管理工具,是 Firefox 火狐浏览器的代理插件,相比比 SwitchProxy、ProxyButton、QuickProxy、xyzproxy、ProxyTex 等扩展提供更多的功能。 FoxyProxy 通过使用通配符、正则表达式和...

    Proxy Pattern Informatization Research Based On SaaS

    Abstract—Based on demands in proxy pattern, this article proposes informatization solution of proxy pattern which includes enterprise management, proxy management, franchisee management and supply ...

    Senfore_DragDrop_v4.1

    The define *must* be made in the project options. It is not sufficient to #define it in the source. If you manage to compile with C++ Builder (any version), I would very much like to know about it...

    apache Proxy_Error

    apache Proxy Error apache Proxy Error apache Proxy Error apache Proxy Error

    智能合约源代码TUSD.pdf

    */ contract Proxy { /** * @dev Tells the address of the implementation where every call will be delegated. * @return address of the implementation to which it will be delegated */ function ...

    ftpproxy-1.2.3.rar_Linux c proxy_ftpproxy_ftp代理_linux ftp_proxy-

    proxy源代码,linux下的ftp 代理的源代码,大家多多支持啊

    Proxy Server serves FTP clients

    Proxy Server functionality - RFC 1919.Actually FTP clients can connect to FTP servers directly and can transmit and receive files or data directly through direct sockets connections, but in some cases...

Global site tag (gtag.js) - Google Analytics