• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ProxyFactory initialization error - Spring 1.2.1

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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:

java.lang.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.

Thanks!

Todd Farmer
 
Todd Farmer
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured it out. I was using CGLIB 2.0.2 when I needed 2.1. Bummer.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic