`

Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the clas

 
阅读更多
2012-8-23 13:07:09 org.springframework.context.support.AbstractApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@bf32c: startup date [Thu Aug 23 13:07:09 CST 2012]; root of context hierarchy
2012-8-23 13:07:09 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [ApplicationContext-mybatis.xml]
2012-8-23 13:07:10 org.springframework.core.io.support.PropertiesLoaderSupport loadProperties
信息: Loading properties file from class path resource [jdbc.properties]
2012-8-23 13:07:10 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@e6ff0d: defining beans [forumMybatisTemplateDao,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,announcementService,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,dataSource,sqlSessionFactory,org.mybatis.spring.SqlSessionTemplate#0,org.mybatis.spring.mapper.MapperScannerConfigurer#0,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0,announcementMybatisDao]; root of factory hierarchy
2012-8-23 13:07:10 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@e6ff0d: defining beans [forumMybatisTemplateDao,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,announcementService,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,dataSource,sqlSessionFactory,org.mybatis.spring.SqlSessionTemplate#0,org.mybatis.spring.mapper.MapperScannerConfigurer#0,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0,announcementMybatisDao]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'announcementService' defined in file [E:\Workspaces\java\songjy\songjy-sm-1.0\target\classes\cn\com\songjy\sm\service\mybatis\AnnouncementService.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces.
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
	at cn.com.songjy.sm.test.Test.main(Test.java:39)
Caused by: org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces.
	at org.springframework.aop.framework.DefaultAopProxyFactory.createAopProxy(DefaultAopProxyFactory.java:67)
	at org.springframework.aop.framework.ProxyCreatorSupport.createAopProxy(ProxyCreatorSupport.java:104)
	at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:112)
	at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:476)
	at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:362)
	at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1461)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	... 11 more



缺少jar包cglib-2.2.2.jar(见附件)
分享到:
评论
1 楼 Xujian0000abcd 2015-11-09  
Thanks...

相关推荐

    CGLIB2 is not available&org.objectweb.asm.Type

    关于Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces.和 java.lang.ClassNotFoundException: org.objectweb.asm.Type错误的解决方法: 就是...

    cglib-nodep

    org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces 从异常信息可以看出是cglib的问题...

    Spring源码缺失的spring-cglib-repack-3.2.6.jar和spring-objenesis-repack-2.6.jar

    在Spring框架中,`spring-cglib-repack-3.2.6.jar`和`spring-objenesis-repack-2.6.jar`是两个重要的依赖库,它们在Spring源码环境中扮演着不可或缺的角色。本文将详细介绍这两个库以及它们在Spring框架中的作用。 ...

    Cglib的jar文件 Cglib.zip

    System.out.println("Target method is executed."); } } } ``` 在这个例子中,`MyTargetClass`是我们要代理的类,通过`Enhancer`我们创建了一个它的子类并设置了一个拦截器。当我们通过代理对象调用`...

    java动态代理(JDK和cglib)共10页.pdf.z

    Service serviceProxy = (Service) Proxy.newProxyInstance( Service.class.getClassLoader(), new Class[]{Service.class}, new LoggingInvocationHandler(new ServiceImpl()) ); serviceProxy.execute(); ``` ...

    cglib.jar/cglib-nodep.jar免费下载

    Object result = proxy.invokeSuper(obj, args); System.out.println("After method call"); return result; } } class MyClass { public void myMethod() { System.out.println("MyClass's method called");...

    CGLIB需要的asm-2.2.3.jar和cglib-nodep-2.2.jar

    CGLIB,全称为Code Generation Library,是一个强大的高性能的代码生成库,被广泛应用于Java世界,尤其是Spring框架中。它允许程序在运行时动态地创建Java对象并扩展已有类的功能。CGLIB是通过字节码技术实现的,而...

    spring 3.x 需要的jar包 spring-cglib-repack-3.1.jar

    在Spring中,AOP有两种实现方式:基于代理的(proxy-based)和基于织入的(aspect-oriented weaving)。基于代理的AOP可以分为JDK动态代理和CGLIB动态代理,前者针对实现了接口的类,后者针对未实现接口的类。 至于...

    Senfore_DragDrop_v4.1

    4) Add the Drag and Drop Component Suite components directory to your library path. 5) Load the demo project group: demo\dragdrop_delphi.bpg for Delphi 5 and 6 demo\dragdrop_bcb4.bpg for C++ ...

    cglib-nodep-2.2.2.jar.zip

    Object result = proxy.invokeSuper(obj, args); System.out.println("After method call"); return result; } }); MyClass myClass = (MyClass) enhancer.create(); myClass.myMethod(); } public ...

    CgLib2.2 API

    CgLib2.2 API cglib Packages net.sf.cglib.beans net.sf.cglib.core net.sf.cglib.proxy net.sf.cglib.reflect net.sf.cglib.transform net.sf.cglib.transform.impl net.sf.cglib.util

    java动态代理(JDK和cglib)共10页.pdf.zip

    - 代理类是在运行时通过`Proxy.newProxyInstance()`方法动态生成的,它需要一个类加载器、一个接口列表和一个InvocationHandler实例。 - 代理类实现了接口列表中的所有接口,因此它可以被当作这些接口的实例来使用...

    pring-objenesis-repack-2.4.jar spring-cglib-repack-3.2.4.jar

    这在某些测试场景或者特殊情况下非常有用,比如Spring的Proxy代理模式,它可能需要在对象生命周期的早期阶段就创建实例。Objenesis与传统的`new`关键字创建对象的方式不同,它能跳过JVM的完全初始化过程,提高了效率...

    Java动态代理Proxy和cglib

    System.out.println("Doing something in the target class"); } } class MyMethodInterceptor implements MethodInterceptor { @Override public Object intercept(Object obj, Method method, Object[] args,...

    cglib-2.2.2-javadoc.chm

    自制CHM版的API文档,带索引。 注:如果各位下载后打开或无法显示页面,请在CHM文件右键—属性—解除锁定即可。

    输出JDK和CGLib动态代理产生的class文件.zip

    - target/classes:编译后的class文件,包括目标接口和实现类的class文件,以及由Proxy生成的代理类class文件 - 测试代码:展示如何使用Proxy创建代理对象并调用方法 2. CGLib代理项目: - src/main/java:包含...

    proxool-0.9.1.jar proxool_cglib-0.9.1.jar

    标题中的"proxool-0.9.1.jar"和"proxool_cglib-0.9.1.jar"是两个Java库文件,它们是Proxool项目在0.9.1版本时的实现。Proxool是一个开源的数据库连接池,它提供了一种灵活且高效的解决方案来管理数据库连接。在Java...

    cglib-2.2.0.jar

    Object result = proxy.invokeSuper(obj, args); System.out.println("方法执行结束:" + method.getName()); return result; } }); MyService myServiceProxy = (MyService) enhancer.create(); myServiceProxy...

    Cglib3.3.0最新版jar包

    Cglib就是一种实现动态代理的方式,不同于JDK自带的Proxy,Cglib不需要目标对象实现任何接口,因此可以用于不能实现接口的对象。通过Enhancer类,我们可以指定需要代理的目标类,并提供回调方法实现动态代理逻辑。 ...

Global site tag (gtag.js) - Google Analytics