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

listener for handling exceptions thrown from ItemReader.open()


    • Type: Enhancement
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.4.0.Alpha1
    • Fix Version/s: None
    • Component/s: jberet-core
    • Labels:


      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

        Gliffy Diagrams


            Issue Links



                • Assignee:
                  cfang Cheng Fang
                  cfang Cheng Fang
                • Votes:
                  0 Vote for this issue
                  1 Start watching this issue


                  • Created: