File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
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(
at net.sf.cglib.core.ClassEmitter.<init>(
at net.sf.cglib.core.KeyFactory$Generator.generateClass(
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(
at net.sf.cglib.core.AbstractClassGenerator.create(
at net.sf.cglib.core.KeyFactory$Generator.create(
at net.sf.cglib.core.KeyFactory.create(
at net.sf.cglib.core.KeyFactory.create(
at net.sf.cglib.proxy.Enhancer.<clinit>(
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
at org.springframework.aop.framework.DefaultAopProxyFactory.<clinit>(
at org.springframework.aop.framework.ProxyConfig.<init>(
at org.springframework.aop.framework.AdvisedSupport.<init>(
at org.springframework.aop.framework.ProxyFactory.<init>(
at com.apress.example.HelloWorldWithDI.main(

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:
subject: ProxyFactory initialization error - Spring 1.2.1
jQuery in Action, 3rd edition