Spring aop报错:com.sun.proxy.$Proxyxxx cannot be cast to yyy
来源:互联网 发布:单片机实验 编辑:程序博客网 时间:2024/05/14 04:30
在使用Spring AOP时,遇到如下的错误:Exception in thread "main" java.lang.ClassCastException: com.sun.proxy.$Proxy0 cannot be cast to com.spring.test.setter.Instrumentalistat com.spring.test.setter.test.main(test.java:12)
看报错信息,显示的是动态代理生成的类无法转换到我们自定义的实现类。
解决办法:
在aop:config标签中添加 proxy-target-class=”true” 即可。
阅读全文
0 0
- Spring aop报错:com.sun.proxy.$Proxyxxx cannot be cast to yyy
- Spring aop报错:com.sun.proxy.$Proxyxxx cannot be cast to yyy
- Spring aop报错:com.sun.proxy.$Proxyxxx cannot be cast to yyy
- Spring报错:java.lang.ClassCastException: com.sun.proxy.$Proxy2 cannot be cast to *
- Spring——AOP com.sun.proxy.$Proxy7 cannot be cast to xxx
- Spring:com.sun.proxy.$proxy0 cannot be cast to XXX
- com.sun.proxy.$Proxy4 cannot be cast to spring.HelloService
- Spring com.sun.proxy.$Proxy6 cannot be cast to
- Spring:com.sun.proxy.$Proxy6 cannot be cast to
- hibernate-spring测试报错:com.sun.proxy.$Proxy44 cannot be cast to com.mm.service.imp.RoleServic
- Java动态代理 报 com.sun.proxy.$Proxy0 cannot be cast to ** 的错误
- com.sun.proxy.$Proxy29 cannot be cast to
- com.sun.proxy.$Proxy25 cannot be cast to SessionImplementor
- com.sun.proxy.$Proxy0 cannot be cast to ** 解决方法
- ssh报错java.lang.ClassCastException: com.sun.proxy.$Proxy6 cannot be cast to org.service.impl.EmpServi
- FAQ(22):java.lang.ClassCastException: com.sun.proxy.$Proxy7 cannot be cast to com.spring.Helloworld1
- java.lang.ClassCastException: com.sun.proxy.$Proxy* cannot be cast to***问题解决方案
- java.lang.ClassCastException: com.sun.proxy.$Proxy27 cannot be cast to com.bbk.n002.service.Question
- 调试javascript的技巧
- Java序列化机制和原理
- LeetCode基础--二叉树-判断二叉树是否平衡
- Tensorflow Serving不支持py_func
- Android性能优化之App瘦身攻略
- Spring aop报错:com.sun.proxy.$Proxyxxx cannot be cast to yyy
- zabbix 相关(索引)
- java处理线程阻塞的小技巧
- 生成带有文字图片的工具
- matterport MASK RCNN配置
- sshd源码下载与编译安装
- oracle 创建dblink
- RESTful API设计细节
- [NOI2010] 超级钢琴