I am writing a Spring Batch program which reads a file, processes then writes to a db. While executing the batch there may be errors in different stages of the program. For example:
- An error can occur while parsing the line in
ItemReader
- An error can occur while processing the line in
ItemProcessor
- An error can occur while writing the line to the db
ItemWriter
So my question is, how can i get the line number of the error? Is there an easy way to get this?
Edit: I already found the link about FieldSetMapper SpringBatch - Get Line Number on FieldSetMapper. But my question includes ItemProcessor and ItemWriter also.
Thanks for the help.