[ 
https://issues.apache.org/jira/browse/CAMEL-6927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13811951#comment-13811951
 ] 

Sree Panchajanyam D edited comment on CAMEL-6927 at 11/2/13 11:38 AM:
----------------------------------------------------------------------

I have figured out that  fallback converter which I coded up is causing this 
issue in all versions starting from 2.9.3. This is of course working perfectly 
good in camel 2.9.2.

When I put this converter along with POJO declared as a bean to do some 
conversion, camel is trying to convert this  POJO into 
org.apache.camel.Processor.

Attaching the stack trace and FallBackConverterCode. It is really weird that 
one piece of code breaks something totally unrelated from user standpoint.


was (Author: sreepanchajanyam):
I have written a fallback converter which is causing this issue in all versions 
starting from 2.9.3. When I put this converter along with custom beans, the 
custom beans are forced to be converted into FallBackConverter.

Attaching the stack trace and FallBackConverterCode. It is really weird that 
one piece of code breaks something totally unrelated from user standpoint.

> Bean Transformer throwing org.apache.camel.TypeConversionException: Error 
> during type conversion from type: due argument type mismatch
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-6927
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6927
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.3, 2.9.4, 2.9.5, 2.10.0, 2.10.1, 2.10.2, 2.10.3, 
> 2.10.4, 2.10.5, 2.10.6, 2.10.7, 2.11.2
>         Environment: Windows 7
>            Reporter: Sree Panchajanyam D
>            Priority: Blocker
>              Labels: features
>         Attachments: EventToPayloadExtracter.java, StackTrace.txt
>
>
> Same piece of camel.xml and POJO working in  camel 2.9.2.
> Issue encountered in camel 2.9.3 and all above versions.
> When trying to start apache camel embedded inside activemq (or camel starting 
> as standalone on Jetty container), I encountered the following exception : 
> Caused by: org.apache.camel.TypeConversionException: Error during type 
> conversion from type: com.messagetransformers.StringAppenderBean to the 
> required type: org.apache.camel.Processor with value 
> com.messagetransformers.StringAppenderBean@77b407 due argument type mismatch
>        at 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:126)
>        at 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:98)
>        at 
> org.apache.camel.util.CamelContextHelper.convertTo(CamelContextHelper.java:72)
> Extract from my camel.xml
> <bean id="beanTransformer" 
> class="com.messagetransformers.StringAppenderBean"/>
>  <camelContext xmlns="http://camel.apache.org/schema/spring";>
>       <route id="beanTransformRoute" autoStartup="true">
>             <description>Transformer Route</description>
>             <from uri="activemqRoute1:MY.QUEUE.1"/>
>                       <bean ref="beanTransformer" method="process"/>
>             <to uri="activemqRoute1:MY.QUEUE.2"/>
>         </route>
> </camelContext>
> Code snippet from that is causing this issue 
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.java(doConvertTo 
> method) 
>  Object rc;
>             if (tryConvert) {
>                 rc = tc.tryConvertTo(type, exchange, value);
>             } else {
>                 rc = tc.convertTo(type, exchange, value);
>             }
> The else part is not there in Camel 2.9.2 and is introduced from Camel 2.9.3.
> This code seems to force a  normal bean to register as a 
> FallbackTypeConverter which is causing the issue.
> Removing the else condition from camel 2.10.3 solved the issue. 
> My question is, is it expected that normal bean definitions should fail from 
> upwards of camel 2.9.3? Documentation seems to say nothing about it.   Please 
> help



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to