I am getting an exception:
DEBUG - Message exchange has failed so breaking out of pipeline:
Exchange[Message:
MSH|^~\&|SAP-ISH|HZL|||20040805152637||ADT^A01|123456|T|2.2|||ER
EVN|A01|20040805152637
PID|1||79471||Meier^Elfriede|Meier|19400101|W|||Hauptstrasse
23^^Essen^NW^11000^DE^H|||||S|||111-11-1111||||Essen
NK1|1|Meier^Elfriede|EMC|Hauptstrasse
23^^Essen^NW^11000^DE|333-4444~333-5555
PV1|1|I|ISKA|R||||823745217||||||||N|||79237645|||||||||||||||||||||||||20040805000000
] Exception: org.apache.camel.InvalidPayloadException: No body available of
type: xxx.yyy.zzz.SampleType but has value: [B@b950d1 of type: byte[] on:
Message: [B@b950d1. Caused by: No type converter available to convert from
type: byte[] to the required type: xxx.yyy.zzz.SampleType with value
[B@b950d1 on the exchange: Exchange[Message: [B@b950d1]
Even though I see that a type converter to handle this has been loaded:
DEBUG - Loading converter class: xxx.yyy.zzz.SampleTypeConverter
This is my type converter:
package xxx.yyy.zzz;
import org.apache.camel.Converter;
@Converter
public class SampleTypeConverter {
@Converter
public static SampleType toSampleType(byte[] body) {
String msgstr = body.toString();
SampleType sampleType = new SampleType();
sampleType.setParam1(msgstr.substring(msgstr.indexOf("MSH"),
msgstr.indexOf("MSH")+5));
sampleType.setParam2(msgstr.substring(msgstr.indexOf("EVN"),
msgstr.indexOf("EVN")+5));
sampleType.setParam3(msgstr.substring(msgstr.indexOf("PID"),
msgstr.indexOf("PID")+5));
return sampleType;
}
}
Any help would be appreciated. Thanks.
--
View this message in context: http://old.nabble.com/%22No-type-converter-available%22-I%27ve-defined-converter-and-see-it-is-loaded.-tp27768567p27768567.html
Sent from the Camel - Users mailing list archive at Nabble.com.
View this message in context: http://old.nabble.com/%22No-type-converter-available%22-I%27ve-defined-converter-and-see-it-is-loaded.-tp27768567p27768567.html
Sent from the Camel - Users mailing list archive at Nabble.com.