{
try {
skipProcessDelegate.onSkipProcessItem(item, (Exception) t);
} catch (Exception e) {
- //TODO: Do something here
+ throw new BatchRuntimeException(e);
}
}
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/launch/JsrJobOperator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/launch/JsrJobOperator.java
index f6becc767..c1d4347d7 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/launch/JsrJobOperator.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/jsr/launch/JsrJobOperator.java
@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Properties;
import java.util.Set;
+import javax.batch.operations.BatchRuntimeException;
import javax.batch.operations.JobExecutionAlreadyCompleteException;
import javax.batch.operations.JobExecutionIsRunningException;
import javax.batch.operations.JobExecutionNotMostRecentException;
@@ -62,29 +63,29 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
/**
* The entrance for executing batch jobs as defined by JSR-352. This class provides
* a base {@link ApplicationContext} that is the equivalent to the following:
- *
+ *
*
* @Configuration
* @EnableBatchProcessing
* public static class BaseConfiguration extends DefaultBatchConfigurer {
- *
+ *
* @Bean
* JobLauncher jobLauncher() { ... }
- *
+ *
* @Bean
* org.springframework.batch.core.launch.JobOperator batchJobOperator(JobExplorer jobExplorer,
* JobLauncher jobLauncher,
* JobRepository jobRepository,
* JobRegistry jobRegistry) { ... }
- *
+ *
* @Bean
* JobExplorerFactoryBean jobExplorer(final DataSource dataSource) { ... }
- *
+ *
* @Bean
* DataSource dataSource() { ... }
* }
*
- *
+ *
* @author Michael Minella
* @since 3.0
* @see EnableBatchProcessing
@@ -105,6 +106,7 @@ public class JsrJobOperator implements JobOperator {
((SimpleJobLauncher) jobLauncher).afterPropertiesSet();
((SimpleJobOperator) batchJobOperator).afterPropertiesSet();
} catch (Exception e) {
+ throw new BatchRuntimeException("Unable to bootstrap JobOperator", e);
}
}
@@ -220,6 +222,7 @@ public class JsrJobOperator implements JobOperator {
}
@Override
+ @SuppressWarnings("resource")
public long start(String jobName, Properties params) throws JobStartException,
JobSecurityException {
GenericXmlApplicationContext batchContext = new GenericXmlApplicationContext();