Hi,

I use the rc1 version and I test the restart when there is an error.

I test an extraction from database into a flat file.
I have only one step with JdbcCursorItemReader and with a FaltFileItemWriter (ShouldDeleteIfExist = true).

If saveState of JdbcCursorItemReader = true then after the error when I restart, I have an exception:
ERROR - BatchMain.start(165) | Job Terminated in error:
java.lang.IllegalArgumentException: Value: [ nullmust be serializable.Object of class [null] must be an instance of interface java.io.Serializable
at org.springframework.util.Assert.isInstanceOf(Asser t.java:337)
at org.springframework.batch.item.ExecutionContext.pu t(ExecutionContext.java:67)
at org.springframework.batch.item.ExecutionContext.pu tString(ExecutionContext.java:53)
at org.springframework.batch.core.repository.dao.Jdbc StepExecutionDao$1.processRow(JdbcStepExecutionDao .java:101)
at org.springframework.jdbc.core.JdbcTemplate$RowCall backHandlerResultSetExtractor.extractData(JdbcTemp late.java:1336)
at org.springframework.jdbc.core.JdbcTemplate$1.doInP reparedStatement(JdbcTemplate.java:650)
at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:588)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:638)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:667)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:683)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:691)
at org.springframework.batch.core.repository.dao.Jdbc StepExecutionDao.findExecutionContext(JdbcStepExec utionDao.java:119)
at org.springframework.batch.core.repository.dao.Jdbc StepExecutionDao$StepExecutionRowMapper.mapRow(Jdb cStepExecutionDao.java:359)
at org.springframework.jdbc.core.RowMapperResultSetEx tractor.extractData(RowMapperResultSetExtractor.ja va:92)
at org.springframework.jdbc.core.JdbcTemplate$1.doInP reparedStatement(JdbcTemplate.java:650)
at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:588)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:638)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:667)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:675)
at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:707)
at org.springframework.batch.core.repository.dao.Jdbc StepExecutionDao.getStepExecution(JdbcStepExecutio nDao.java:412)
at org.springframework.batch.core.repository.support. SimpleJobRepository.getStepExecutionCount(SimpleJo bRepository.java:285)
at com.natixis.sphinx.batch.advice.SimpleStepLogAdvic e.doRepriseLogging(SimpleStepLogAdvice.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.springframework.aop.aspectj.AbstractAspectJAdv ice.invokeAdviceMethodWithGivenArgs(AbstractAspect JAdvice.java:627)
at org.springframework.aop.aspectj.AbstractAspectJAdv ice.invokeAdviceMethod(AbstractAspectJAdvice.java: 609)
at org.springframework.aop.aspectj.AspectJAfterAdvice .invoke(AspectJAfterAdvice.java:45)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :160)
at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:106)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
at org.springframework.aop.interceptor.ExposeInvocati onInterceptor.invoke(ExposeInvocationInterceptor.j ava:90)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy0.getLastStepExecution(Unknown Source)
at org.springframework.batch.core.job.SimpleJob.shoul dStart(SimpleJob.java:175)
at org.springframework.batch.core.job.SimpleJob.execu te(SimpleJob.java:103)
at org.springframework.batch.core.launch.support.Simp leJobLauncher$1.run(SimpleJobLauncher.java:90)
at org.springframework.core.task.SyncTaskExecutor.exe cute(SyncTaskExecutor.java:49)
at org.springframework.batch.core.launch.support.Simp leJobLauncher.run(SimpleJobLauncher.java:85)
at com.natixis.sphinx.batch.BatchMain.start(BatchMain .java:156)
at com.natixis.sphinx.batch.BatchMain.main(BatchMain. java:206)
If saveState of JdbcCrusorItemReader = false, then after the error when I restart the job, the file isn't delete before write and then I have the old line written before the error + all the line written after restart and so I have the front line in double.

It seems to be a bug, no?

More, FlatFileItemWriter.restart.count is always = 0. Is this normal?