Uploaded image for project: 'JBeret'
  1. JBeret
  2. JBERET-472

listener for handling exceptions thrown from ItemReader.open()

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • Major
    • None
    • 1.4.0.Alpha1
    • jberet-core
    • None

    Description

      The following description is copied from the stackoverflow question and its comments:

      Is there any listener interface that one could implement to handle exceptions thrown from ItemReader.open() methods? There's plenty of listener interfaces but no one seems to be suitable for this. i.e. ItemReadListener catches only exceptions from ItemReader.readItem() (similar to ChunkListener or ItemProcessListener etc.)

      There are JobListener and StepListener interfaces but these two don't define methods that would be called in case of exception.

      Is there any way how to do this?


      You may be able to use ChunkListener#onError(Exception e) to "catch" any exception within a chunk. This will work in certain implementations, like WebSphere Liberty / Open Liberty, but may not work in every implementation (since this was a grey area of the specification).


      ItemReader.open() is out of the scope of ChukListener. If I understand the concept correctly open() is called before the chunks are performed. However ChukListener.onError() doesn't catch the excpetion. At least in the JBeret implementation of JSR352

      Attachments

        Issue Links

          Activity

            People

              weinanli Weinan Li
              cfang@redhat.com Cheng Fang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: