I am trying to access the records in a text file and storing them in an other text file. I included the exception 'FlatFileParseException' in <batch:skippable-exception-classes> tag so that any bad record should be skipped. However, when I am accessing the output file, only records which occur before exception-causing record are processed and the records which occur after the exception-causing record are not getting processed. Also the error stack trace shows exception as non-skippable.
Below are the excerpts from my code-
bold one is the bad record which should be skipped ideally.
<batch:chunk reader="FileReader" processor="FileProcessor" writer="FileWriter" commit-interval="2" skip-limit="10">
17:30:37,208 ERROR main FlatFileItemReader:182 - Parsing error at line: 4 in resource=URL [file:C:/ankitFilesRead/text.txt], input=[,g,h]
org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 4, input=[problem,g,h].................
Caused by: java.lang.NumberFormatException: Unparseable number:problem .....................
17:30:37,223 ERROR main AbstractStep:213 - Encountered an error executing the step: class org.springframework.batch.core.step.skip.NonSkippableReadException: Non-skippable exception during read...............
Can you please help me understand why the records below the row- problem,g,h are not getting printed in output file and why the exception is being thrown as non-skippable?
public Employee mapFieldSet(FieldSet fs)
if(fs == null)
Employee emp = new Employee();