You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2014/05/06 08:53:14 UTC

[jira] [Created] (CAMEL-7415) lazyLoad with CSV blows up on last line

Willem Jiang created CAMEL-7415:
-----------------------------------

             Summary: lazyLoad with CSV blows up on last line
                 Key: CAMEL-7415
                 URL: https://issues.apache.org/jira/browse/CAMEL-7415
             Project: Camel
          Issue Type: Bug
          Components: camel-csv
    Affects Versions: 2.13.0, 2.12.3
            Reporter: Willem Jiang
            Assignee: Willem Jiang
             Fix For: 2.12.4, 2.13.1


{code}

CsvDataFormat csv = new CsvDataFormat() 
csv.setDelimiter(' ') 
csv.setSkipFirstLine(false) 
csv.setLazyLoad(true) 

CamelContext camelContext = new DefaultCamelContext() 
camelContext.addRoutes(new RouteBuilder() { 
def void configure() { 
from('direct:start') 
.unmarshal(csv) 
.split(body()).streaming() 
.log('row: ${body}') 
} 
}) 
camelContext.start() 

ProducerTemplate t = camelContext.createProducerTemplate() 
t.sendBody('direct:start', new File('/Users/timbo/data/test.txt')) 

camelContext.stop() 

{code}

Here is the exception when camel try to access the last line of the file.

{code}

java.lang.IllegalStateException: java.io.IOException: Stream closed 
at 
org.apache.camel.dataformat.csv.CsvIterator.next(CsvIterator.java:61) 
at 
org.apache.camel.processor.Splitter$SplitterIterable$1.next(Splitter.java:170) 
at 
org.apache.camel.processor.Splitter$SplitterIterable$1.next(Splitter.java:146) 
at 
org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:502) 
{code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)