You have to cache the stream if you want to read it multiple times:
http://camel.apache.org/stream-caching.html

Best,
Christian

On Fri, Jul 27, 2012 at 6:08 PM, marnold <[email protected]> wrote:

> Camel Users,
>
> I need to take a large XML message, split into smaller messages, send each
> small message to a JMS destination, then apply XSLT to original message and
> send that somewhere else...
>
> The split works well, the smaller messages are processed correctly, but
> when
> I try to apply an XSLT to the original (pre-split) message, I get stream
> closed.
>
> My route:
>
> <route id="abc">
>       <from uri="......."/>
>         <split streaming="false" stopOnException="true"
> shareUnitOfWork="true">
>                 <tokenize token="insideTag"
> inheritNamespaceTagName="outsideTag"
> xml="true"/>
>                 <to uri="jms:queue.myJmsQueue"/>
>         </split>
>         <to uri="xslt:myTransform.xsl"/>
>         <to uri="..."/>
> </route>
>
> I get this exception:
>
> [ampPoll] TimerConsumer                  ERROR Error processing exchange.
> Exchange[Message: [Body is instance of java.io.InputStream]]. Caused by:
> [javax.xml.transform.TransformerException -
> javax.xml.transform.TransformerException:
> com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Stream
> closed]
> javax.xml.transform.TransformerException:
> javax.xml.transform.TransformerException:
> com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Stream
> closed
>
> If I replace the <to uri="xslt..."/> with <to uri="file:output.log"/>, I
> get
> this exception:
>
> [ampPoll] TimerConsumer                  ERROR Error processing exchange.
> Exchange[Message: [Body is instance of java.io.InputStream]]. Caused by:
> [org.apache.camel.component.file.GenericFileOperationFailedException -
> Cannot store file: output.log\my-hostname-57144-1343404520362-0-3]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> store file: output.log\my-hostname-57144-1343404520362-0-3
>
> Thanks in advance for any help,
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/After-split-get-Stream-closed-on-original-message-tp5716557.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to