camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Bug in the BeanConverter class
Date Thu, 26 Aug 2010 02:39:18 GMT
Hi Ashwin

I just reproduced the error that you mentioned, I will commit a patch 
for it shortly.

Willem

apejavar wrote:
> I have a camel pipeline route that looks something like this:
> 
> {code}
> <proxy id="someProxy"
>             serviceUrl="direct:someEndpoint"
>             serviceInterface="SomeInterface" />
> 
> <route>
>    <from uri="direct:someEndpoint"/>
>    <to uri="bean:someDecorator"/>
>    <to uri="activemqCore:queue:someQueue?transferException=true"/>
> </route>
> {code}
> 
> The decorator, someDecorator has the following method signature:
> 
> {code}
> void decorate(final BaseClassOfSuper baseClass, final Message message);
> {code}
> 
> Now if I use my proxy to send SuperClass I get a
> NoTypeConversionAvailableException exception.
> 
> Looking at the org.apache.camel.component.bean.BeanConverter class, it has
> (on line 51 of rel 2.4.0):
> 
> {code}
> if (from.isAssignableFrom(type)) {
>                 return body;
> }
> {code}
> 
> This should instead read:
> {code}
> if (type.isAssignableFrom(from)) {
>                 return body;
> }
> {code}
> 
> because you always assign "from" to "type" and not vice versa.
> 
>  - Ashwin
> 


Mime
View raw message