diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBean.java index ebdc75eca..b91e85ce5 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBean.java @@ -59,7 +59,7 @@ public class SkipLimitStepFactoryBean extends SimpleStepFactoryBean { SimpleLimitExceptionHandler exceptionHandler = new SimpleLimitExceptionHandler(); exceptionHandler.setLimit(skipLimit); exceptionHandler.setExceptionClasses(skippableExceptionClasses); - setExceptionHandler(new SimpleLimitExceptionHandler(skipLimit)); + setExceptionHandler(exceptionHandler); getStepOperations().setExceptionHandler(getExceptionHandler()); } else { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBeanTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBeanTests.java index ed507b149..09b1ecf1e 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBeanTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBeanTests.java @@ -24,6 +24,7 @@ import org.springframework.batch.item.ParseException; import org.springframework.batch.item.ResetFailedException; import org.springframework.batch.item.Skippable; import org.springframework.batch.item.UnexpectedInputException; +import org.springframework.batch.repeat.RepeatException; import org.springframework.batch.support.transaction.ResourcelessTransactionManager; /** @@ -33,7 +34,8 @@ public class SkipLimitStepFactoryBeanTests extends TestCase { SkipLimitStepFactoryBean tested = new SkipLimitStepFactoryBean(); - Class[] skippableExceptions = new Class[] { SkippableException.class, SkippableRuntimeException.class }; + // TODO checked exceptions are wrapped as RepeatExceptions by the chunkOperations#exceptionHandler + Class[] skippableExceptions = new Class[] { RepeatException.class, SkippableException.class, SkippableRuntimeException.class }; final int SKIP_LIMIT = 2;