You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Kees de Kooter <kd...@gmail.com> on 2009/11/24 14:54:29 UTC

AmbiguousMethodCallException on transactional spring bean

I have configured a spring bean as a consumer of a message queue. It contains
one method, annotated @Transactional.

Camel throws an AmbiguousMethodCallException. "Ambiguous method invocations
possible [..] public final void
com..TransactionService$$EnhancerByCGLIB$$273a5668.setPrefiltered(boolean)
[..]".

Apparently CGLIB adds a bunch of methods, confusing Camel.

Even if I add the @Handler annotation the error is thrown.

How can I fix this?
-- 
View this message in context: http://old.nabble.com/AmbiguousMethodCallException-on-transactional-spring-bean-tp26496269p26496269.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AmbiguousMethodCallException on transactional spring bean

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Nov 24, 2009 at 2:54 PM, Kees de Kooter <kd...@gmail.com> wrote:
>
> I have configured a spring bean as a consumer of a message queue. It contains
> one method, annotated @Transactional.
>
> Camel throws an AmbiguousMethodCallException. "Ambiguous method invocations
> possible [..] public final void
> com..TransactionService$$EnhancerByCGLIB$$273a5668.setPrefiltered(boolean)
> [..]".
>
> Apparently CGLIB adds a bunch of methods, confusing Camel.
>
> Even if I add the @Handler annotation the error is thrown.
>
> How can I fix this?

Ah cool, lets fix it together :)

There is a methodName you can use to indicate the method to use.

But I guess we should add those CGLIB enhanced classes to the excluded list.
Let me fix some code and if you can test with a SNAPSHOT of 2.1 that
would be cool.



> --
> View this message in context: http://old.nabble.com/AmbiguousMethodCallException-on-transactional-spring-bean-tp26496269p26496269.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: AmbiguousMethodCallException on transactional spring bean

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Nov 24, 2009 at 3:40 PM, Claus Ibsen <cl...@gmail.com> wrote:
> On Tue, Nov 24, 2009 at 3:35 PM, Kees de Kooter <kd...@gmail.com> wrote:
>>
>> Thanks for creating the ticket Claus. I have added a code snippet and a stack
>> trace to the issue.
>>
>
> Which version of Camel are you using?
>
> I have fixed several bugs in it for 2.1 so it may already work in 2.1.
>

For listeners. Kees have confirmed it works in 2.1 and that he used 2.0.0.


>>
>> Claus Ibsen-2 wrote:
>>>
>>> Hi
>>>
>>> I have created a ticket
>>> https://issues.apache.org/activemq/browse/CAMEL-2222
>>>
>>> Feel free to create a small sample application that demonstrates this
>>> issue. That can be used to help fix it and as an unit test for the
>>> future.
>>>
>>>
>> --
>> View this message in context: http://old.nabble.com/AmbiguousMethodCallException-on-transactional-spring-bean-tp26496269p26496798.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: AmbiguousMethodCallException on transactional spring bean

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Nov 24, 2009 at 3:35 PM, Kees de Kooter <kd...@gmail.com> wrote:
>
> Thanks for creating the ticket Claus. I have added a code snippet and a stack
> trace to the issue.
>

Which version of Camel are you using?

I have fixed several bugs in it for 2.1 so it may already work in 2.1.

>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> I have created a ticket
>> https://issues.apache.org/activemq/browse/CAMEL-2222
>>
>> Feel free to create a small sample application that demonstrates this
>> issue. That can be used to help fix it and as an unit test for the
>> future.
>>
>>
> --
> View this message in context: http://old.nabble.com/AmbiguousMethodCallException-on-transactional-spring-bean-tp26496269p26496798.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: AmbiguousMethodCallException on transactional spring bean

Posted by Kees de Kooter <kd...@gmail.com>.
Thanks for creating the ticket Claus. I have added a code snippet and a stack
trace to the issue.


Claus Ibsen-2 wrote:
> 
> Hi
> 
> I have created a ticket
> https://issues.apache.org/activemq/browse/CAMEL-2222
> 
> Feel free to create a small sample application that demonstrates this
> issue. That can be used to help fix it and as an unit test for the
> future.
> 
> 
-- 
View this message in context: http://old.nabble.com/AmbiguousMethodCallException-on-transactional-spring-bean-tp26496269p26496798.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AmbiguousMethodCallException on transactional spring bean

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I have created a ticket
https://issues.apache.org/activemq/browse/CAMEL-2222

Feel free to create a small sample application that demonstrates this
issue. That can be used to help fix it and as an unit test for the
future.



On Tue, Nov 24, 2009 at 2:54 PM, Kees de Kooter <kd...@gmail.com> wrote:
>
> I have configured a spring bean as a consumer of a message queue. It contains
> one method, annotated @Transactional.
>
> Camel throws an AmbiguousMethodCallException. "Ambiguous method invocations
> possible [..] public final void
> com..TransactionService$$EnhancerByCGLIB$$273a5668.setPrefiltered(boolean)
> [..]".
>
> Apparently CGLIB adds a bunch of methods, confusing Camel.
>
> Even if I add the @Handler annotation the error is thrown.
>
> How can I fix this?
> --
> View this message in context: http://old.nabble.com/AmbiguousMethodCallException-on-transactional-spring-bean-tp26496269p26496269.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus