You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2024/02/19 15:15:00 UTC

[jira] [Updated] (CAMEL-20436) Bean method invocations where the bean is a proxy for an Interface & the method has no arguments fail with AmbiguousMethodCallException

     [ https://issues.apache.org/jira/browse/CAMEL-20436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-20436:
--------------------------------
    Priority: Minor  (was: Major)

> Bean method invocations where the bean is a proxy for an Interface & the method has no arguments fail with AmbiguousMethodCallException
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-20436
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20436
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-bean
>    Affects Versions: 3.22.1
>         Environment: Karaf 4.4.4/Java 17/Windows
>            Reporter: Paul McCulloch
>            Priority: Minor
>
> Using OSGi Blueprint a <reference> element can be used to inject an OSGi service into Camel. Methods on the injected service can be called via "bean:someref?method=foo"
> The service is injected as a proxy to the actual OSGi service,
> When BeanInfo attempts to resolve the method it sees two methods named 'foo' : The abstract method of the interface,  and the concrete method of the proxy.
> In camel 3.16 & earlier BeanInfo.findMostSpecificOverride() would determine that one method overrode the other, and would return the proxy's method.
> From 3.17 onwards a changes was made to look at the method's declaring class' isSynthetic() value, and to not consider a synthetic class' method as overriding the interface. The blueprint proxy is synthetic so is affected. 
>  
> The changes was made for https://issues.apache.org/jira/browse/CAMEL-17844 ([https://github.com/apache/camel/pull/7261/commits/5d956d2e4914a5c4fe73e5cae2f2ea7d2429f8e3)]
>  
> This can be worked around by changing the method to take at least one argument. This triggers a different path through the code  - attempting to match the exchange body to the parameter. In this path the isSynthetic() flag isn't considered.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)