报错: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. 【串线篇】概述SpringMvc和spring整合

    SpringMVC和Spring整合的目的:分工明确: SpringMVC的配置文件就来配置和网站转发逻辑以及网站功能有关的(视图解析器,文件上传解析器,支持ajax,xxx):springmvc.x ...

  2. 数据结构---Java---String

    1.概述 1.1 源码(JDK1.8) public final class String implements java.io.Serializable, Comparable<String& ...

  3. Mysql中存储过程和函数的写法

    MySQL中,创建存储过程的基本形式如下: CREATE PROCEDURE sp_name ([proc_parameter[,...]]) [characteristic ...] routine ...

  4. numpy.unique

    Find the unique elements of an array. Returns the sorted unique elements of an array. There are thre ...

  5. sigaction函数学习

    sigaction(查询或设置信号处理方式) 相关函数 signal,sigprocmask() ,sigpending,sigsuspend, sigemptyset 表头文件 #include&l ...

  6. 【Flutter学习】页面跳转之SliverAppBar,CustomScrollView,NestedScrollView的使用

    一,flutter SliverAppbar 控件介绍 SliverAppBar “应用栏” 相当于升级版的 appbar 于 AppBar 位置的固定的应用最上面的; 而 SliverAppBar ...

  7. web服务器和后端语言的关系

    1.web服务nginx和php的相互关系  : https://www.cnblogs.com/luckylihuizhou/p/6387171.html 个人理解:web服务器本身没有处理后端语言 ...

  8. 转载:@RequestParam @RequestBody @PathVariable 等参数绑定注解详解

    转载自:https://blog.csdn.net/walkerjong/article/details/7946109#commentBox   因为写的很好很全,所以转载过来 引言:接上一篇文章, ...

  9. js判断是否pc端

    function IsPC() { var userAgentInfo = navigator.userAgent; var Agents = ['Android', 'iPhone', 'Symbi ...

  10. 《ArcGIS Runtime SDK for .NET开发笔记》 --Hello Word

    这里我们将创建第一个用于显示地图的APP. 1.新建一个WPF程序 首先我们打开Visual Studio,选择新建项目. 选择已安装——模板——Windows桌面——WPF应用程序  2.添加Run ...