camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravi21588 <>
Subject NoTypeConversionAvailableException exception while running junit test case
Date Tue, 09 May 2017 16:48:02 GMT
Hi iam getting NoTypeConversionAvailableException  while using xpath in
camel,iam using camel 2.10.Iam getting this exception only in junit test
case,but it is working fine while deployed in Jboss EAP server.

My camel route is as below:

<?xml version="1.0" encoding="ASCII"?>
<routes xmlns="">
	<route id="TranslatorRoute" streamCache="true">
		<from uri="switchyard://TranslatorService" />
					<log message="choice ${body} " loggingLevel="INFO"/> 
					<log message="Otherwise ${body} " loggingLevel="INFO"/> 
				<log message="Exception " loggingLevel="INFO" />

iam sending a jaxb object as input for the switchyard://TranslatorService
service when invoking from Junit test case.

Iam getting the below type conversion exception when it is calling the camel

org.apache.camel.NoTypeConversionAvailableException: No type converter
available to convert from type:
to the required type: org.w3c.dom.Document with value <?xml version="1.0"
encoding="UTF-8" standalone="yes"?>
<ns2:esb-message xmlns:ns2="">

I have already defined the typeconverter for the Object as below and added
the TypeConverter file in META-INF services.



import org.apache.camel.Converter;


public class esbMessageConverter {

	public static InputStream toInputStream (esbMessage msg) throws Exception {
		String val=new esbMessageHandler(msg).getMessageAsString();
		return new ByteArrayInputStream(val.getBytes("UTF-8"));
	public static String toString (esbMessage msg) throws Exception {
		return new esbMessageHandler(msg).getMessageAsString();
	public static esbMessage fromString (String src) throws Exception {
		return esbMessageHandler.readesbMessageFromXml(src);

can you please help me with this issue.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message