I am using the following spring xml file to split the xml content of a file to different files.
<camelContext id="camelroute" xmlns="http://activemq.apache.org/camel/schema/spring"> <route> <from uri="file:///D:/testing/file1.xml"/> <splitter> <xpath>//student/name</xpath> <to uri="file:///D:/testing/file2"/> </splitter> </route> </camelContext> Running the above spring xml throws an InvalidPayloadException. The example given in camel documentaion in Java DSL: from("activemq:my.queue").splitter(xpath("//foo/bar")).to("file://some/directory") also do not work since the splitter returns a DeferredElementNSImpl type whereas the file endpoint expects the exchange to be an InputStream. Since it is Java DSL, there is a way to specify return type as "String.class" or any other type in the xpath expression to fix this. But I need to use Spring configuration for my requirement. Thanks for any help in this regard. -- View this message in context: http://www.nabble.com/Sending-splitter-output-to-a-file-throws-InvalidPayloadException-tp19838250s22882p19838250.html Sent from the Camel - Users mailing list archive at Nabble.com.
