You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Robert Thullner <rt...@gmx.at> on 2008/01/30 16:33:39 UTC
Camel Splitter - XML content
Hi
I am sending a a JMSTextMessage with XML content to a SM JMS Consumer. Then
the Camel SE should take the message, split it and send it to a JMS
Provider.
My message looks like this:
<document>
<patient>
....
</patient>
<paymentInfo>
...
</paymentInfo>
<history>
...
</history>
</document>
For the splitting I use this camel route:
XPathBuilder splitNurseSystem = new XPathBuilder("/document/*");
from("jbi:endpoint:http://eip.hospital.servicemix/routing/endpoint")
.splitter(splitNurseSystem)
.to("jbi:service:http://eip.hospital.servicemix/doctorService");
When I send a message, I get the following exception:
ERROR - JmsComponent - Error processing exchange InOnly[
id: ID:192.168.2.102-117cb20e17c-4:15
status: Active
role: provider
service: {http://eip.hospital.servicemix}doctorService
endpoint: enpoint
in: null
]
javax.xml.stream.XMLStreamException: Trying to write END_DOCUMENT when
document has no root (ie. trying to output empty document).
at
com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1473)
at
com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1502)
at
com.ctc.wstx.sw.BaseStreamWriter.finishDocument(BaseStreamWriter.java:1663)
at
com.ctc.wstx.sw.BaseStreamWriter.writeEndDocument(BaseStreamWriter.java:585)
at
org.apache.servicemix.soap.marshalers.SoapWriter.writeSimpleMessage(SoapWriter.java:130)
at
org.apache.servicemix.soap.marshalers.SoapWriter.write(SoapWriter.java:92)
at
org.apache.servicemix.jms.DefaultJmsMarshaler.toJMS(DefaultJmsMarshaler.java:79)
at
org.apache.servicemix.jms.DefaultJmsMarshaler.toJMS(DefaultJmsMarshaler.java:106)
at
org.apache.servicemix.jms.AbstractJmsProcessor.fromNMS(AbstractJmsProcessor.java:164)
at
org.apache.servicemix.jms.multiplexing.MultiplexingProviderProcessor.process(MultiplexingProviderProcessor.java:136)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)
at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
I would think that after the splitting, the content of my messages should
still be XML, so I do not really understand the exception.
Do I need a custom marshaller or some XSLT transformations to get the
splitter working or is there a simpler way?
Thanks for help
Robert
--
View this message in context: http://www.nabble.com/Camel-Splitter---XML-content-tp15183441s12049p15183441.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.