but was actually of type [$Proxy19]
来源:互联网 发布:90后童年游戏 知乎 编辑:程序博客网 时间:2024/05/22 15:33
混用出现的问题but was actually of type [$Proxy29]
默认好像就是cglib.jar 的byType扫描吧!
引用一下http://panyongzheng.iteye.com/blog/1407922(转)
出现这个异常,spring框架AOP才用JDK动态代理只能对实现了接口的类实现动态代理,而不能针对类,我自己在搭建项目的时候没有用接口的模式,所以在应用启动时候,配置AOP事务 的时候会扫描你的service层,service层用到了Dao层的接口代理模式(spring 默认) 因为我没有采用接口模式编程,所以报错...
如果不才用接口模式那么 就要用CGLIB
而CGLIB是针对类实现代理,(主要生成一个子类,覆盖其中的方法)
因为是继承,所以该类或方法最好不要声明成final的类...
在applicationContext.xml 配置中加上
<aop:aspectj-autoproxy proxy-target-class="true"/>
把cglib.jar导入工程中即可以
- but was actually of type [$Proxy19]
- ......but was actually of type [sun.proxy.$Proxy8]
- “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 '*' must be of type [*], but was actually of type [com.sun.proxy.$Proxy34]
- BeanNotOfRequiredTypeException: Bean named "" must be of type [] but was actually of type [com.sun.p
- Bean named 'BService' is expected to be of type 'path1' but was actually of type 'path2'
- is expected to be of type but was actually of type 'com.sun.proxy.$Proxy70'
- BeanNotOfRequiredTypeException: Bean named "" must be of type [] but was actually of type [com.su
- Bean named 'transactionAdvice' must be of type [org.aopalliance.aop.Advice], but was actually of typ
- Java RMI方式调用问题 but was actually of type [$Proxy7]
- BeanNotOfRequiredTypeException 异常:but was actually of type 'com.sun.proxy.$Proxy17'
- 使用spring遇到"BeanNotOfRequiredTypeException......but was actually of type [com.sun.proxy.$Proxy18]"异常
- 使用spring遇到"BeanNotOfRequiredTypeException......but was actually of type [com.sun.proxy.$Proxy18]"异常
- but was actually of type 'com.sun.proxy.$Proxy**'的两种解决方法
- Spring AOP事物异常 but was actually of type 'com.sun.proxy.$Proxy17
- showModalDialog想访问父窗口的数据的
- 黑马程序员---ASP.NET页面之间传递值
- 非常好的Struts2请求处理流程及源码分析(强烈推荐!)
- 怎样在Android中监听声音改变事件
- 组合键捕获事件
- but was actually of type [$Proxy19]
- showModalDialog在原窗口刷新,不弹出新的窗口
- Webservice_18_利用Handler实现方法认证
- 学Spring控制反转(IoC)的三个阶段
- web集群时session同步的3种方法
- c语言自定义函数大全
- iOS开源项目
- Hibernate入门DEMO
- 漫谈Microsoft SQL Server连接中常见问题