报错: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…..的更多相关文章

  1. 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

  2. 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 ...

  3. Jupyterhub Error 503: Proxy Target Missing

    Jupyterhub Error 503: Proxy Target Missing 请求太频繁

  4. AOP和IOC的实现原理(用到的设计模式)

    文章来源:http://blog.csdn.NET/longyulu/article/details/36174979 用过spring的朋友都知道spring的强大和高深,都觉得深不可测,其实当你真 ...

  5. spring源码分析(二)Aop

    创建日期:2016.08.19 修改日期:2016.08.20-2016.08.21 交流QQ:992591601 参考资料:<spring源码深度解析>.<spring技术内幕&g ...

  6. spring aop源码实现分析

    1. 先分析Advice before执行Cglib2AopProxy的intercept方法: /** * General purpose AOP callback. Used when the t ...

  7. spring源码 — 三、AOP代理生成

    AOP代理生成 AOP就是面向切面编程,主要作用就是抽取公共代码,无侵入的增强现有类的功能.从一个简单的spring AOP配置开始: <?xml version="1.0" ...

  8. (转)springAOP解析-1

    原文:http://hzbook.group.iteye.com/group/wiki/2261-Spring 3.1  Spring AOP概述 3.1.1  AOP概念回顾AOP是Aspect-O ...

  9. Spring学习(二)——Spring中的AOP的初步理解[转]

      [前面的话] Spring对我太重要了,做个关于web相关的项目都要使用Spring,每次去看Spring相关的知识,总是感觉一知半解,没有很好的系统去学习一下,现在抽点时间学习一下Spring. ...

随机推荐

  1. vue - blog开发学习5

    基本功能和后台联调 1.首页的所有博客 因为是前后台都是本地开发,所以前端vue需要设置proxy:修改/config/index.js中的这个proxyTable proxyTable: { '/a ...

  2. Java面试宝典(6)混合(前端 + 数据库)

    包括html & JavaScript & Ajax部分/Java web部分/数据库部分 三. html&JavaScript&ajax部分 1. 判断第二个日期比第 ...

  3. Ubuntu下安装chrome浏览器步骤

    进入 Ubuntu 18.04 桌面,按下 Ctrl + Alt + t 键盘组合键,启动终端. 也可以按下 Win 键(或叫 Super 键),在 Dash 的搜索框中输入 terminal 或“终 ...

  4. Redis的常用命令及数据类型

    Redis支持的五种数据类型 字符串 (string) 字符串列表 (list) 散列 (hash) 字符串集合 (set) 有序字符串集合 (sorted-set) key(键) keys * 获取 ...

  5. test命令-linux shell 脚本

    #!/bin/bash # This is program will check you file name,which sys has or not,end print types. #2019/0 ...

  6. java的BigDecimal比较大小

    java的BigDecimal比较大小 //前提为a.b均不能为null if(a.compareTo(b) == -1){ System.out.println("a小于b"); ...

  7. URAL 1057 Amount of Degrees (数位dp)

    Create a code to determine the amount of integers, lying in the set [X;Y] and being a sum of exactly ...

  8. Some Simple Mistakes I had

    This week, I had some mistakes. It is really hard to say: #1 py business what's happening l = abs(px ...

  9. Objective-C UIWebview JS 交互

    一.在OC中调用网页中的 js 方法. Objective-C 代码 [self.webView stringByEvaluatingJavaScriptFromString:@"alert ...

  10. JS-监听整个页面上的DOM树变化

    # [在线预览](https://jsfiddle.net/1010543618/fyf913t0/) ## 方法 - 使用<Web API 接口>的<MutationObserve ...