简体   繁体   中英

BeanIO item reader Comments require reader.markSupported() to return true

I have my beanioItemReader map defined as follows -

<stream name="DTA" format="fixedlength">
    <parser>
        <property name="comments" value="#" />
    </parser>
...

And getting the exception -

jberet - WARN  JBERET000001: Failed to run batchlet org.jberet.job.model.RefArtifact@67af20cb
java.lang.IllegalArgumentException: Comments require reader.markSupported() to return true
    at org.beanio.stream.util.CommentReader.<init>(CommentReader.java:61) ~[beanio-2.1.0.jar:2.1.0]
    at org.beanio.stream.fixedlength.FixedLengthReader.<init>(FixedLengthReader.java:101) ~[beanio-2.1.0.jar:2.1.0]

I do not see any documented properties to pass to the beanioItemReader for comments. Can/How do I get comments to work?

The location to BeanIO mapping file is configured in BeanIOItemReaderWriterBase class , so whatever configuration specified in the mapping file will be passed to the underlying BeanIO reader.

From the stack trace, it looks like it's complaining about the underlying reader does not support mark ( reader.markSupported returns false). But JBeret BeanIOItemReader class uses a BufferedReader , which does support mark.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM