org.springframework.batch.core.UnexpectedJobExecutionException: Encountered an error saving batch meta data.

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • This excepton didn't appear every time.It seems that Spring was updating the step's version after step finished.According to below logs,the current step's version was 548(want to update to 549) and its version was also 548 in DB.So the update should success.But we met below exception. 05 May 2012 10:21:27 [WAPIBatchScheduler_Worker-1] ERROR org.springframework.batch.core.step.AbstractStep - Encountered an error saving batch meta data.This job is now in an unknown state and should not be restarted. org.springframework.dao.OptimisticLockingFailureException: Attempt to update step execution id=1065721 with wrong version (548), where current version is 548 at org.springframework.batch.core.repository.dao.JdbcStepExecutionDao.updateStepExecution(JdbcStepExecutionDao.java:334) at org.springframework.batch.core.repository.support.SimpleJobRepository.saveOrUpdate(SimpleJobRepository.java:239) at org.springframework.batch.core.repository.support.SimpleJobRepository.saveOrUpdateExecutionContext(SimpleJobRepository.java:248) at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:172) at org.springframework.batch.core.job.SimpleJob.execute(SimpleJob.java:125) at com.webex.webapp.wbxconnect.batch.ClassPathXmlApplicationContextJobLocator$ContextClosingJob.execute(ClassPathXmlApplicationContextJobLocator.java:174) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:86) at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49) at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:81) at com.webex.webapp.wbxconnect.batch.ClassPathXmlApplicationContextJobLocator.run(ClassPathXmlApplicationContextJobLocator.java:100) at com.webex.webapp.wbxconnect.executeplugin.batch.SubmitJob.submitJobExecution(SubmitJob.java:420) at com.webex.webapp.wbxconnect.executeplugin.batch.SubmitJob.submitClusterJobExecution(SubmitJob.java:333) at com.webex.webapp.wbxconnect.batch.SpringBatchJobInvoker.execute(SpringBatchJobInvoker.java:77) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529) 05 May 2012 10:21:28 [WAPIBatchScheduler_Worker-1] ERROR com.webex.webapp.wbxconnect.batch.WapiGlobalJobStepListener - [Z2PJ8VTTIR8XSUTXJJ8BW2EWT9] [dirGrpIntegration] [] An error occurred in Job Execution org.springframework.batch.core.UnexpectedJobExecutionException: Encountered an error saving batch meta data. at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:218) at org.springframework.batch.core.job.SimpleJob.execute(SimpleJob.java:125) at com.webex.webapp.wbxconnect.batch.ClassPathXmlApplicationContextJobLocator$ContextClosingJob.execute(ClassPathXmlApplicationContextJobLocator.java:174) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:86) at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49) at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:81) at com.webex.webapp.wbxconnect.batch.ClassPathXmlApplicationContextJobLocator.run(ClassPathXmlApplicationContextJobLocator.java:100) at com.webex.webapp.wbxconnect.executeplugin.batch.SubmitJob.submitJobExecution(SubmitJob.java:420) at com.webex.webapp.wbxconnect.executeplugin.batch.SubmitJob.submitClusterJobExecution(SubmitJob.java:333) at com.webex.webapp.wbxconnect.batch.SpringBatchJobInvoker.execute(SpringBatchJobInvoker.java:77) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
    via by benjamin xi,
  • This excepton didn't appear every time.It seems that Spring was updating the step's version after step finished.According to below logs,the current step's version was 548(want to update to 549) and its version was also 548 in DB.So the update should success.But we met below exception. 05 May 2012 10:21:27 [WAPIBatchScheduler_Worker-1] ERROR org.springframework.batch.core.step.AbstractStep - Encountered an error saving batch meta data.This job is now in an unknown state and should not be restarted. org.springframework.dao.OptimisticLockingFailureException: Attempt to update step execution id=1065721 with wrong version (548), where current version is 548 at org.springframework.batch.core.repository.dao.JdbcStepExecutionDao.updateStepExecution(JdbcStepExecutionDao.java:334) at org.springframework.batch.core.repository.support.SimpleJobRepository.saveOrUpdate(SimpleJobRepository.java:239) at org.springframework.batch.core.repository.support.SimpleJobRepository.saveOrUpdateExecutionContext(SimpleJobRepository.java:248) at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:172) at org.springframework.batch.core.job.SimpleJob.execute(SimpleJob.java:125) at com.webex.webapp.wbxconnect.batch.ClassPathXmlApplicationContextJobLocator$ContextClosingJob.execute(ClassPathXmlApplicationContextJobLocator.java:174) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:86) at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49) at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:81) at com.webex.webapp.wbxconnect.batch.ClassPathXmlApplicationContextJobLocator.run(ClassPathXmlApplicationContextJobLocator.java:100) at com.webex.webapp.wbxconnect.executeplugin.batch.SubmitJob.submitJobExecution(SubmitJob.java:420) at com.webex.webapp.wbxconnect.executeplugin.batch.SubmitJob.submitClusterJobExecution(SubmitJob.java:333) at com.webex.webapp.wbxconnect.batch.SpringBatchJobInvoker.execute(SpringBatchJobInvoker.java:77) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529) 05 May 2012 10:21:28 [WAPIBatchScheduler_Worker-1] ERROR com.webex.webapp.wbxconnect.batch.WapiGlobalJobStepListener - [Z2PJ8VTTIR8XSUTXJJ8BW2EWT9] [dirGrpIntegration] [] An error occurred in Job Execution org.springframework.batch.core.UnexpectedJobExecutionException: Encountered an error saving batch meta data. at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:218) at org.springframework.batch.core.job.SimpleJob.execute(SimpleJob.java:125) at com.webex.webapp.wbxconnect.batch.ClassPathXmlApplicationContextJobLocator$ContextClosingJob.execute(ClassPathXmlApplicationContextJobLocator.java:174) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:86) at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49) at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:81) at com.webex.webapp.wbxconnect.batch.ClassPathXmlApplicationContextJobLocator.run(ClassPathXmlApplicationContextJobLocator.java:100) at com.webex.webapp.wbxconnect.executeplugin.batch.SubmitJob.submitJobExecution(SubmitJob.java:420) at com.webex.webapp.wbxconnect.executeplugin.batch.SubmitJob.submitClusterJobExecution(SubmitJob.java:333) at com.webex.webapp.wbxconnect.batch.SpringBatchJobInvoker.execute(SpringBatchJobInvoker.java:77) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
    via by benjamin xi,
    • org.springframework.batch.core.UnexpectedJobExecutionException: Encountered an error saving batch meta data. at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:218) at org.springframework.batch.core.job.SimpleJob.execute(SimpleJob.java:125) at com.webex.webapp.wbxconnect.batch.ClassPathXmlApplicationContextJobLocator$ContextClosingJob.execute(ClassPathXmlApplicationContextJobLocator.java:174) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:86) at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49) at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:81) at com.webex.webapp.wbxconnect.batch.ClassPathXmlApplicationContextJobLocator.run(ClassPathXmlApplicationContextJobLocator.java:100) at com.webex.webapp.wbxconnect.executeplugin.batch.SubmitJob.submitJobExecution(SubmitJob.java:420) at com.webex.webapp.wbxconnect.executeplugin.batch.SubmitJob.submitClusterJobExecution(SubmitJob.java:333) at com.webex.webapp.wbxconnect.batch.SpringBatchJobInvoker.execute(SpringBatchJobInvoker.java:77) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
    No Bugmate found.