camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Minh Tran <>
Subject bean binding regression bug
Date Sun, 29 May 2016 23:40:26 GMT

I’m seeing an unusual problem with bean binding when I upgraded from 2.17.0 to 2.17.1. 

I’ve simplified it to the following example

public interface IBar {
	Object load();

public interface IFoo extends IBar {
	Object fooLoad();

public class Foo implements IFoo {
	public Integer load() {
		return 1;

	public Integer fooLoad() {
		return 2;

The route is 


When using 2.17.1, the first route fails with the following exception

org.apache.camel.component.bean.MethodNotFoundException: Method with name: load not found
on bean: of type:
	at org.apache.camel.component.bean.BeanInfo.createInvocation( ~[camel-core-2.17.1.jar:2.17.1]
	at org.apache.camel.component.bean.BeanInfo.createInvocation( ~[camel-core-2.17.1.jar:2.17.1]
	at org.apache.camel.component.bean.BeanProcessor.process( ~[camel-core-2.17.1.jar:2.17.1]
	at org.apache.camel.util.AsyncProcessorHelper.process( [camel-core-2.17.1.jar:2.17.1]
	at org.apache.camel.component.bean.BeanProcessor.process( ~[camel-core-2.17.1.jar:2.17.1]
	at org.apache.camel.component.bean.BeanProducer.process( ~[camel-core-2.17.1.jar:2.17.1]

The second route passes and calls the method correctly.

When using 2.17.0, both routes call the methods successfully.

From debugging the camel source code in both versions, I think the problem lies in the BeanInfo.introspect
method. 2.17.0 did an extra check on bridge methods but this is now missing in 2.17.1

// skip bridge methods in duplicate checks (as the bridge method is inserted by the compiler
due to type erasure)
if (source.isBridge()) {

It’s probably a combination of both using bridge methods and a complicated inheritance structure
that is causing this bug. However it is a third party library I am interfacing against so
I cannot simply change the code myself. I can probably get around it by writing an adapter
but I’m not keen on it.

View raw message