[ 
https://issues.apache.org/jira/browse/CAMEL-14126?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-14126.
---------------------------------
    Fix Version/s:     (was: 3.x)
                   3.0.0
         Assignee: Claus Ibsen
       Resolution: Fixed

Added a explicit close. You can work around this on 2.x, by adding a 
convertBodyTo(byte[].class) before calling the splitter.

> stax component can cause infinite loop of file component
> --------------------------------------------------------
>
>                 Key: CAMEL-14126
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14126
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-stax
>    Affects Versions: 2.24.2
>            Reporter: tomahi
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 3.0.0
>
>         Attachments: staxSample.zip
>
>
> I discovered a situation where the stax component causes an infinite loop of 
> the file component in case of invalid UTF-8 characters in the file. I 
> attached a sample project with the most simplistic route that shows the 
> behaviour:  [^staxSample.zip] 
> The input file containes invalid UTF-8 characters. The route definition is as 
> following:
> {code:java}
> from("file://inbound?moveFailed=.failed")
>     .split(stax(Product.class))
>         .log("${body.name}");
> {code}
> I get the exceptions
> {quote}
> Error renaming file from C:\Users\...\inbound\products.xml to 
> inbound\.failed\products.xml
> {quote}
> and
> {quote}
> [javax.xml.stream.XMLStreamException: ParseError at [row,col]:[4,29]
> Message: Ungültiges Byte 2 von 3-Byte-UTF-8-Sequenz.]
> {quote}
> When I marshal the whole document at once I don't get the first exception. 
> When I use the splitter with tokenizeXML I won't get any of the exceptions.
> ----
> The sample contains another example where a combination of Splitter with 
> aggregation + seda route called by inOut and an exception in the seda route 
> causes the infinite loop too (Message is "error renaming file" as above). 
> I could figure out that the issue doesn't occur if at least one of the 
> following changes:
> - the Exception is thrown in the "file"-route instead of in the seda route
> - the aggregation returns the newExchange if the oldExchange is null instead 
> of creating a new DefaultExchange
> - "to" instead of "inOut" is used to call the seda endpoint



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to