Cannot proxy target class because CGLIB2 is not available .Add CGLIB to the class path or specify proxy interfaces…..
报错:Cannot proxy target class because CGLIB2 is not available .Add CGLIB to the class path or specify proxy interfaces…..
问题原因:
Spring框架,如果类实现了接口,就使用JDK的动态代理生成代理对象,如果这个类没有实现任何接口,就使用CGLIB生成代理对象。
解决办法有两种:
方案一让类实现某个接口;
方案二导入CGLIB包;
cglib是一个开源项,一个强大的,高性能,高质量的Code生成类库,它可以在运行期扩展Java类与实现Java接口。
本工程用的spring3.0.7,导入cglib-3.1.jar
继续报错:
Initialization of bean failed; nested exception is java.lang.IncompatibleClassChangeError: net/sf/cglib/core/DebuggingClassWriter
换成cglib-2.3.jar
问题解决
Cannot proxy target class because CGLIB2 is not available .Add CGLIB to the class path or specify proxy interfaces…..的更多相关文章
- Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces
问题解决:缺少jar包 cglib-2.1.3.jar
- Spring3.x错误---- Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces.
Spring3.x错误: 解决方法: 缺少cglib的包, 下载地址: http://sourceforge.net/projects/cglib/files/latest/download?sour ...
- Jupyterhub Error 503: Proxy Target Missing
Jupyterhub Error 503: Proxy Target Missing 请求太频繁
- AOP和IOC的实现原理(用到的设计模式)
文章来源:http://blog.csdn.NET/longyulu/article/details/36174979 用过spring的朋友都知道spring的强大和高深,都觉得深不可测,其实当你真 ...
- spring源码分析(二)Aop
创建日期:2016.08.19 修改日期:2016.08.20-2016.08.21 交流QQ:992591601 参考资料:<spring源码深度解析>.<spring技术内幕&g ...
- spring aop源码实现分析
1. 先分析Advice before执行Cglib2AopProxy的intercept方法: /** * General purpose AOP callback. Used when the t ...
- spring源码 — 三、AOP代理生成
AOP代理生成 AOP就是面向切面编程,主要作用就是抽取公共代码,无侵入的增强现有类的功能.从一个简单的spring AOP配置开始: <?xml version="1.0" ...
- (转)springAOP解析-1
原文:http://hzbook.group.iteye.com/group/wiki/2261-Spring 3.1 Spring AOP概述 3.1.1 AOP概念回顾AOP是Aspect-O ...
- Spring学习(二)——Spring中的AOP的初步理解[转]
[前面的话] Spring对我太重要了,做个关于web相关的项目都要使用Spring,每次去看Spring相关的知识,总是感觉一知半解,没有很好的系统去学习一下,现在抽点时间学习一下Spring. ...
随机推荐
- 【目录】mysql 架构篇系列
随笔分类 - mysql 架构篇系列 mysql 架构篇系列 4 复制架构一主一从搭建(半同步复制) 摘要: 一.概述 在mysql 5.5之前,mysql 的复制是异步操作,主库和从库的数据之间存在 ...
- 数据库并发及锁机制及Hibernate锁实现
数据库事务的定义 数据库事务(Database Transaction),是指作为单个逻辑工作单元执行的一系列操作.一个逻辑工作单元要成为事务,必须满足所谓的ACID(原子性.一致性.隔离性和持久性) ...
- word--->pdf资料转载..
https://blog.csdn.net/dsn727455218/article/details/80667927
- HumanNet v2:用于疾病研究的人类基因网络 X科研网
HumanNet v2:用于疾病研究的人类基因网络人类基因网络已被证明在疾病研究的许多方面都很有用,已经开发了许多基于网络的策略来产生关于基因 - 疾病 - 药物关联的假设.预测和组织与特定疾病最相关 ...
- springColud父工程依赖配置
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot ...
- PHP rewinddir() 函数
打开一个目录,列出其中的文件,充值目录句柄,重新列出其中的文件,然后关闭: <?php$dir = "/images/"; // Open a directory, and ...
- 【HDU6602】Longest Subarray【线段树+分治】
题目大意:给出一串序列,询问最长的合法子串为多长,其中合法子串必须满足子串中[1,C]的数量大于等于K或者为0 题解: 定义右端点为包含某一点所需要的最小区间的右端点 那么初始化时就可以O(n)求出每 ...
- centos6编译安装php7
https://www.cnblogs.com/wenwei-blog/p/6261637.html https://www.cnblogs.com/imzye/p/5109770.html cent ...
- [CSP-S模拟测试]:抛硬币(DP)
题目背景 小$A$和小$B$是一对好朋友,他们经常一起愉快的玩耍.最近小$B$沉迷于**师手游,天天刷本,根本无心搞学习.但是小$B$已经入坑了几个月,却一次都没有抽到$SSR$,让他非常怀疑人生.勤 ...
- 极限IO优化
namespace IO{ #define BUF_SIZE 100000 #define OUT_SIZE 100000 #define ll long long //fread->read ...