Mar 6th, 2009, 01:29 PM
In Spring Batch 1.1, when my FFIR encountered a problem parsing a line, it gave a nice error message showing which line in the file encountered the problem.
In Spring Batch 2.0, it no longer provides such contextual information.
Is there a reason that this was removed? We really relied on this to determine where in the file the problem occurred.
Mar 6th, 2009, 02:19 PM
So, it looks like the 'lineNumber' context is now passed to the LineMapper by the FFIR. Unfortunately, the DefaultLineMapper ignores this parameter and invokes the fieldsetmapper and linetokenizer nakedly (neither of which is passed this context) so any exceptions thrown by either of these collaborators bypass the mapper and bubbles up, losing the linenumber context in the process.
It would be very useful if this implementation could catch exceptions thrown by either the fieldsetmapper or linetokenizer, wrap them with a new exception containing the line number (like the previous incarnation of the FFIR) and rethrow.
Mar 6th, 2009, 05:02 PM
If you log an issue in JIRA about this we will discuss it.
Thanks for the input.
Mar 7th, 2009, 09:54 AM