Results 1 to 4 of 4

Thread: FlatFileItemReader question

  1. #1
    Join Date
    Jan 2008
    Location
    San Diego
    Posts
    780

    Default FlatFileItemReader question

    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.

  2. #2
    Join Date
    Jan 2008
    Location
    San Diego
    Posts
    780

    Default

    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.

  3. #3
    Join Date
    Feb 2008
    Posts
    488

    Default

    Hi,

    If you log an issue in JIRA about this we will discuss it.

    Thanks for the input.

  4. #4
    Join Date
    Jan 2008
    Location
    San Diego
    Posts
    780

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •