You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, I apologize for posting this message in English, as I am using ChatGPT for translation due to my limited English proficiency.
I have been reviewing the skip feature in Spring Batch.
I implemented the reader as a JsonItemReader and used JacksonJsonObjectReader as the jsonObjectReader.
To intentionally trigger a ParseException, I set the age field as a string, as shown below.
However, rather than skipping the error as expected, the process terminated at this point.
Upon further investigation, I observed that in JacksonJsonObjectReader.read(), an IOException results in a ParseException being thrown. However, the jsonParser token remains at the error position rather than moving to the next object. Consequently, when attempting to read the following item, jsonParser.nextToken() returns FIELD_NAME, which results in null being returned, thereby terminating the process prematurely even though there are more items to read.
To ensure that the skip functionality works correctly, it seems necessary to add a mechanism that advances the token to the next object in the event of an error.
First, I apologize for posting this message in English, as I am using ChatGPT for translation due to my limited English proficiency.
I have been reviewing the skip feature in Spring Batch.
I implemented the reader as a JsonItemReader and used JacksonJsonObjectReader as the jsonObjectReader.
To intentionally trigger a ParseException, I set the age field as a string, as shown below.
However, rather than skipping the error as expected, the process terminated at this point.
Upon further investigation, I observed that in JacksonJsonObjectReader.read(), an IOException results in a ParseException being thrown. However, the jsonParser token remains at the error position rather than moving to the next object. Consequently, when attempting to read the following item, jsonParser.nextToken() returns FIELD_NAME, which results in null being returned, thereby terminating the process prematurely even though there are more items to read.
To ensure that the skip functionality works correctly, it seems necessary to add a mechanism that advances the token to the next object in the event of an error.
For reference, the job configuration I used can be found here:
RestartJob.java on GitHub
Thank you very much for your attention to this matter.
The text was updated successfully, but these errors were encountered: