You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2019/11/12 11:32:00 UTC
[jira] [Updated] (CAMEL-14126) stax component can cause infinite
loop of file component
[ https://issues.apache.org/jira/browse/CAMEL-14126?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-14126:
--------------------------------
Priority: Minor (was: Major)
> 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
> Priority: Minor
> Fix For: 3.x
>
> 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)