Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Won't Fix
-
3.14.6
-
None
-
None
-
Unknown
Description
After upgrading from 3.14.4 to 3.14.6 we can no longer call camel bean method on an instance of OSGI service which implements an interface. This is caused by the changes introduced in CAMEL-18411.
Example:
route:
public class TestRoute extends RouteBuilder { @BeanInject private MyInterface myInterface; @Override public void configure() { from("...") .bean(myInterface, "reinit"); } }
The MyInterface is:
public interface MyInterface { void reinit(); }
The object injected is a proxy reference to OSGI service, injected by blueprint in karaf runtime.
Stacktrace:
org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous method invocations possible: [public void Proxyb113d9d3_4aac_4ac9_b619_9bb68d221255.reinit(), public abstract void foo.bar.MyInterface.reinit()] on the exchange: Exchange[92BC3141E43445D-000000000000003F] at org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:246) at org.apache.camel.component.bean.AbstractBeanProcessor.process(AbstractBeanProcessor.java:126) at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:81) at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:818) at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:726) at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:193) at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:64) at org.apache.camel.processor.Pipeline.process(Pipeline.java:185) at
The ambiguousness is caused by the reinit() method detected twice - once from the interface, and one from the Proxy class.
I'm working on a solution.
cc: AWeickel