PDA

View Full Version : AutoProxyCreator, lookup-method and overloaded methods


thijs
Oct 12th, 2004, 09:36 AM
I have a class that has a overloaded method. This class is cglib proxied by AutoProxyCreator so it participates in Hibernate transactions.

In the bean tag I define a lookup method:
<lookup-method name="createPage" bean="page"/>

On startup a java.lang.ClassFormatException is thrown with the message:
Repetitive method name/signature in class file {...}$$EnhancerByCGLIB$$fd52ded2$$EnhancerByCGLIB$ $25b980a8

The lookup method process works fine in other proxied beans. The only difference I've been able to find is the overloaded message.

If I don't proxy the bean, the lookup-method works to.

Is using overloaded methods in this setup not supported? Am I missing something?

Rod Johnson
Oct 13th, 2004, 05:22 AM
Do you overload the lookup method itself, or another method? Overloading the lookup method is not supported: the assumption is that there is one no-arg method with that name. It would be possible to change this, but it would make the implementation more complex and their might be a performance cost. If there's an issue with other overloaded methods, it's a bug and I'll try to address it.

thijs
Oct 13th, 2004, 05:56 AM
No, I'm overloading another method.

The method I'm trying to reimplement with Spring is a single no-argument method.

Rod Johnson
Oct 13th, 2004, 06:38 AM
I'll look at it today. I've raised a JIRA issue: http://opensource.atlassian.com/projects/spring/browse/SPR-391.

Rod Johnson
Oct 13th, 2004, 12:45 PM
I've reproduced this in a test case, and am researching it further. I think it may be a CGLIB issue.

Rod Johnson
Oct 25th, 2004, 04:57 AM
Please attach any further comments to the issue in JIRA.

Thanks,
Rod