Eric Manuguerra [https://community.jboss.org/people/michel.strogoff] created 
the discussion

"CGLIB errors"

To view the discussion, visit: https://community.jboss.org/message/733834#733834

--------------------------------------------------------------
Hi,

I am trying to deploy a subset of a Spring 2.5.6 application on JBoss AS 7.1.1 
(this application is currently running on JBoss 5.1.0 GA).

I have installed Snowdrop on JBoss as explained in the  
http://docs.redhat.com/docs/en-US/JBoss_Web_Framework_Kit/1.1/html-single/Snowdrop_1.1_User_Guide/index.html
 manual.

The application is an EAR having the following structure :

app-root
     /lib
          ...
          cglib-2.1_3.jar
          ...
     /META-INF
          application.xml
          jboss-deployment-structure.xml
     
     module1.jar


The module1.jar contains the Spring application context definition files which 
are loaded by org.jboss.spring.vfs.context.VFSClassPathXmlApplicationContext.

After startup, Spring complains about a missing cglib library and raises an 
AopConfigException :

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)
 [spring-aop.jar:2.5.6.SEC02]
          at 
org.springframework.aop.framework.ProxyCreatorSupport.createAopProxy(ProxyCreatorSupport.java:106)
 [spring-aop.jar:2.5.6.SEC02]
          at 
org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110) 
[spring-aop.jar:2.5.6.SEC02]
          at 
org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:490)
 [spring-aop.jar:2.5.6.SEC02]
          at 
org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:365)
 [spring-aop.jar:2.5.6.SEC02]
          at 
org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:325)
 [spring-aop.jar:2.5.6.SEC02]
          at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:361)
 [spring-beans.jar:2.5.6.SEC02]
          at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1344)
 [spring-beans.jar:2.5.6.SEC02]
          at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
 [spring-beans.jar:2.5.6.SEC02]


If I add the cglib library as a dependency of the 
org.springframework.spring:snowdrop module, then I get an 
IllegalArgumentException :

java.lang.IllegalArgumentException: class 
com.itesoft.share.persistence.iod.multitenant.TenantInterceptor$$EnhancerByCGLIB$$398b4762_3
 is not an enhanced class
          at net.sf.cglib.proxy.Enhancer.setCallbacksHelper(Enhancer.java:618) 
[cglib-2.1_3.jar:]
          at net.sf.cglib.proxy.Enhancer.setThreadCallbacks(Enhancer.java:609) 
[cglib-2.1_3.jar:]
          at 
net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:631) 
[cglib-2.1_3.jar:]
          at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538) 
[cglib-2.1_3.jar:]
          at 
net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
 [cglib-2.1_3.jar:]
          at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) 
[cglib-2.1_3.jar:]
          at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285) 
[cglib-2.1_3.jar:]
          at 
org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:201)
 [spring-aop.jar:2.5.6.SEC02]
          ... 189 more


I don't understand why this is happening and I can't find much information 
about tyhe "not an enhanced class" exception.

I don't encounter these errors on JBoss 5.1.0 with the same Spring and CGLIB 
versions. 

Any help would be much appreciated.

Best regards,
Eric
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/733834#733834]

Start a new discussion in Snowdrop at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2082]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to