camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sree Panchajanyam D (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAMEL-6927) Bean Transformer throwing org.apache.camel.TypeConversionException: Error during type conversion from type: due argument type mismatch
Date Fri, 01 Nov 2013 18:49:17 GMT
Sree Panchajanyam D created CAMEL-6927:
------------------------------------------

             Summary: 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.11.2, 2.10.7, 2.10.6, 2.10.5, 2.10.4, 2.10.3, 2.10.2, 2.10.1, 2.10.0,
2.9.5, 2.9.4, 2.9.3
         Environment: Windows 7
            Reporter: Sree Panchajanyam D
            Priority: Blocker


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)

Mime
View raw message