I Just want to learn custom converter and ran into issue. Any help is much appreciated. Camel Version 2.17 and JBoss Fuse 6.3
@Converter
public class MyConvertor{
public MyConvertor(){}
@Converter
public static String convertTo(Exchange exchange) {}
}
In My Spring DSL
<convertBodyTo charset="UTF-8" id="_convertBodyTo1" type="com.x.convertor.MyConvertor"/>
In META-INF/services/org/apache/camel/TypeConverter
com.x.convertor.MyConvertor
Error message :
org.apache.camel.InvalidPayloadException: No body available of type: com.x.convertor.MyConvertor but has value: GenericFile[output.txt] of type: org.apache.camel.component.file.GenericFile on: output.txt. Caused by: No type converter available to convert from type:
at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
Caused by: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFile to the required type: com.x.convertor.MyConvertor