jQuery in Action, 3rd edition
The moose likes Other Application Frameworks and the fly likes ProxyFactory initialization error - Spring 1.2.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "ProxyFactory initialization error - Spring 1.2.1" Watch "ProxyFactory initialization error - Spring 1.2.1" New topic

ProxyFactory initialization error - Spring 1.2.1

Todd Farmer
Ranch Hand

Joined: May 28, 2004
Posts: 59

I'm having problems initializing a ProxyFactory object in my Spring 1.2.1-enabled test app. I was getting a ClassNotFound error, but resolved that by putting ASM in my classpath. Now, I get an IllegalAccessError:

at net.sf.cglib.core.ClassEmitter.setTarget(ClassEmitter.java:47)
at net.sf.cglib.core.ClassEmitter.<init>(ClassEmitter.java:39)
at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:165)
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215)
at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:64)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at org.springframework.aop.framework.DefaultAopProxyFactory.<clinit>(DefaultAopProxyFactory.java:57)
at org.springframework.aop.framework.ProxyConfig.<init>(ProxyConfig.java:72)
at org.springframework.aop.framework.AdvisedSupport.<init>(AdvisedSupport.java:104)
at org.springframework.aop.framework.ProxyFactory.<init>(ProxyFactory.java:43)
at com.apress.example.HelloWorldWithDI.main(HelloWorldWithDI.java:34)

The code is pretty straight-forward:

I get the same exception regardless of whether I use the no-arg constructor or pass the target as the argument.

Any ideas why this is happening? ClassNotFound exceptions I can figure out; this I can't.


Todd Farmer
Todd Farmer
Ranch Hand

Joined: May 28, 2004
Posts: 59
I figured it out. I was using CGLIB 2.0.2 when I needed 2.1. Bummer.
I agree. Here's the link: http://aspose.com/file-tools
subject: ProxyFactory initialization error - Spring 1.2.1
jQuery in Action, 3rd edition