camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apejavar <ashwin.pejavar+ca...@gmail.com>
Subject Bug in the BeanConverter class
Date Thu, 26 Aug 2010 00:38:54 GMT

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

-- 
View this message in context: http://camel.465427.n5.nabble.com/Bug-in-the-BeanConverter-class-tp2653552p2653552.html
Sent from the Camel Development mailing list archive at Nabble.com.

Mime
View raw message