PDA

View Full Version : AOP on Classes implementing generic interfaces fails


solman
Sep 17th, 2004, 09:07 PM
I have had a problem using AOP on classes that implement generic interfaces. Before I understood that this was the problem, I posted about this issue here:

http://forum.springframework.org/showthread.php?t=10384

I have a many classes of the form:

ThingManager extends java.lang.Object implements Manager<Thing>

When I attempt to have TransactionProxyFactoryBean generate CGLIB proxies for me, it throws a StackOverflowError due to an apparently infinite recursion in the CGLIB libraries (please see the referenced post for a copy of the message).

Removing the generified interface declaration makes everything work properly.

Is using CGLIB on generics verboten? Is this a bug in CGLIB? Is this a bug in the way Spring uses CGLIB? Is there a work around for this? Or am I simply mistaken?

Thanks for any help you can offer.

robh
Sep 18th, 2004, 04:55 AM
Doh! Just spotted this post after replying to the previous one.

I'm not sure as yet if CGLIB has support for generics. I will speak to the guys there and see what the situation is.

Rob