0
私はちょうどカスタムコンバータを学びたいと思って問題に遭遇しました。どんな助けでも大歓迎です。キャメルバージョン2.17とJBossヒューズ6.3私の春のDSLでSpring DSLを使用したCamelカスタム@Converterに関する問題
@Converter
public class MyConvertor{
public MyConvertor(){}
@Converter
public static String convertTo(Exchange exchange) {}
}
<convertBodyTo charset="UTF-8" id="_convertBodyTo1" type="com.x.convertor.MyConvertor"/>
com.x.convertor.MyConvertor
META-INF /サービス/組織/ apacheの/キャメル/のTypeConverterでエラーメッセージ:
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
幸運。以下のように変更が更新されました。あなたは コンバータ パブリッククラスMyConvertor { \tコンバータ \t公共JSONObjectにconvertTo(GenericFileファイル)JSONException、IOExceptionが{ \t \tリターンjsonObjectスロー助けてくださいでした。 \t} } –