On Fri, Jun 5, 2009 at 2:57 PM, cgveld<[email protected]> wrote: > > Hi, > > I recently started using Camel. It seems to be very powerful and useful, but > also sometimes a bit complex. > Anyway... Most things work great, but I do have a question. > I get an Exception when I try to read a Document from a JmsMessage. > > I'll first try to explain what I am doing: > 1. I get a message on an activemq queue > 2. I take the id from this message and put a xml file on the 'IN' > (this happens in a processor) > exchange.getIn().setBody(new File(filename)); > 3. I process the message, this processor tries to read the message as a > document > Document document = exchange.getIn().getBody(Document.class); > > This is where the following errors occur: > org.apache.camel.NoTypeConversionAvailableException: No type converter > available to convert from type: class > org.apache.camel.component.jms.JmsMessage to the required type: > java.io.InputStream with value JmsMessage: ActiveMQTextMessage > > 4. I evaluate an xpath expression on the document > 5. I remove the result from the expression from the document > 6. I put the document on the IN of the exchange again. > > Strangely enough it seems the xpath expression can be evaluated and even the > nodes are deleted from the document. Although I got an exception reading the > document? > How is this possible? And even more important, how can I solve this? > > Can anybody help me? Hi
Welcome on board the Camel ride. Can you post the route and what version of Camel you are using. It would help understand what you do. The problem could be the fact that you kinda wreck the JmsMessage as you replace it with a File body. So you should probably replace the entire Message with a neutral message that is not JMS specific. Message msg = new DefaultMessage(); msg.setBody(new File...) // replace with our neutral message exchange.setIn(msg); > > Thanks, > > Jeroen > > P.S. I noticed there are no converters from JmsMessage to anything in the > list so I could understand if my code wouldn't work at all. But it seems to > work fine, except for the exception. > -- > View this message in context: > http://www.nabble.com/Exception-on-typeconversion%2C-but-result-is-ok--tp23887671p23887671.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
