Hi all,
I am newer to camel and fuse. I have a route to select a record from database then convert to xml file or stream.
my route is:
<route id="calls-route">
<from uri="timer:foo?period=5s"/>
<to uri="sql:{{sql.selectCalls}}"/>
<convertBodyTo type="java.util.Map"/>
<to uri="bean:callsBean?method=processCalls"/>
<to uri="log:foo"/>
</route>
I always get exception like
org.apache.camel.InvalidPayloadException: No body available of type: java.util.Map but has value: [{local_callkey=181695, server_id=902}
It will get the similiar error if change <convertBodyTo type="java.util.Map"/> to <convertBodyTo type="javax.xml.transform.stream.StreamSource"/> or
<convertBodyTo type="javax.xml.transform.Source"/>.
but it works if I using <convertBodyTo type="java.lang.String"/>. It will not have any advantage if I convert a string to xml.
This question was also asked at the Fuse Forum where we have given an answer
http://fusesource.com/forums/thread.jspa?threadID=4801&tstart=0