diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/SkipListenerAdapter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/SkipListenerAdapter.java index ab0834c5f..2fd7e7f44 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/SkipListenerAdapter.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/SkipListenerAdapter.java @@ -7,8 +7,9 @@ import javax.batch.operations.BatchRuntimeException; import org.springframework.batch.core.SkipListener; -public class SkipListenerAdapter implements SkipListener { +import java.util.List; +public class SkipListenerAdapter implements SkipListener { private final SkipReadListener skipReadDelegate; private final SkipProcessListener skipProcessDelegate; private final SkipWriteListener skipWriteDelegate; @@ -32,7 +33,13 @@ public class SkipListenerAdapter implements SkipListener { @Override public void onSkipInWrite(S item, Throwable t) { - //TODO: This will take more than just wrapping... + if(skipWriteDelegate != null && t instanceof Exception) { + try { + skipWriteDelegate.onSkipWriteItem((List) item, (Exception) t); + } catch (Exception e) { + throw new BatchRuntimeException(e); + } + } } @Override