Spring-Batch无效的JobExecution,找不到ID

时间:2016-07-29 10:18:52

标签: java spring spring-batch

我正在尝试在循环中运行少量spring-batch个作业。一些工作成功完成。但是其他人没有,并且日志中会抛出以下异常:

<ERROR> [org.springframework.batch.core.job.AbstractJob] :Encountered fatal error executing job
org.springframework.batch.core.repository.dao.NoSuchObjectException: **Invalid JobExecution, ID <theid> not found.**
        at org.springframework.batch.core.repository.dao.JdbcJobExecutionDao.updateJobExecution(JdbcJobExecutionDao.java:197)
        at 

applicationContext.xml具有以下配置:

<beans:bean id="jobRepository"
    class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean">
    <beans:property name="databaseType" value="POSTGRES" />
    <beans:property name="dataSource" ref="dataSource" />
    <beans:property name="transactionManager" ref="transactionManager" />
    <beans:property name="isolationLevelForCreate" value="ISOLATION_DEFAULT" />
</beans:bean>

<beans:bean id="jobLauncher"
    class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
    <beans:property name="jobRepository" ref="jobRepository" />
</beans:bean>

<beans:bean id="jobExplorer" class="org.springframework.batch.core.explore.support.JobExplorerFactoryBean">
    <beans:property name="dataSource" ref="dataSource" />
</beans:bean>

<beans:bean id="transactionManager"
    class="org.springframework.jdbc.datasource.DataSourceTransactionManager" >
    <beans:property name="dataSource"
    ref="dataSource" />
</beans:bean>

0 个答案:

没有答案