Skip to content

Concurrent Modification Exception when generating Paycheck PDF #1

@rdehuyss

Description

@rdehuyss
Hibernate: select taxcalcula0_.id as id1_4_0_, taxcalcula0_.calculationDate as calculat2_4_0_, taxcalcula0_.employee_id as employee7_4_0_, taxcalcula0_.jobExecutionId as jobExecu3_4_0_, taxcalcula0_.month as month4_4_0_, taxcalcula0_.tax as tax5_4_0_, taxcalcula0_.year as year6_4_0_, employee1_.id as id1_0_1_, employee1_.email as email2_0_1_, employee1_.firstName as firstNam3_0_1_, employee1_.income as income4_0_1_, employee1_.lastName as lastName5_0_1_ from TaxCalculation taxcalcula0_ inner join Employee employee1_ on taxcalcula0_.employee_id=employee1_.id where taxcalcula0_.id=?
Hibernate: insert into PayCheck (jobExecutionId, payCheckPdf, taxCalculation_id) values (?, ?, ?)
2014-06-04 22:28:46,983 ERROR  [AbstractStep] Encountered an error executing step wsCallAndGenerateAndSendPaycheckStep in job employeeJob 
org.springframework.retry.RetryException: Non-skippable exception in recoverer while processing; nested exception is java.util.ConcurrentModificationException
    at org.springframework.batch.core.step.item.FaultTolerantChunkProcessor$2.recover(FaultTolerantChunkProcessor.java:281)
    at org.springframework.retry.support.RetryTemplate.handleRetryExhausted(RetryTemplate.java:458)
    at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:320)
    at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:193)
    at org.springframework.batch.core.step.item.BatchRetryTemplate.execute(BatchRetryTemplate.java:217)
    at org.springframework.batch.core.step.item.FaultTolerantChunkProcessor.transform(FaultTolerantChunkProcessor.java:290)
    at org.springframework.batch.core.step.item.SimpleChunkProcessor.process(SimpleChunkProcessor.java:192)
    at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:75)
    at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:402)
    at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:326)
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
    at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:267)
    at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:77)
    at org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate$ExecutingRunnable.run(TaskExecutorRepeatTemplate.java:262)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.util.ConcurrentModificationException
    at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:886)
    at java.util.ArrayList$Itr.next(ArrayList.java:836)
    at fr.opensagres.xdocreport.template.freemarker.FreemarkerDocumentFormatter.setConfiguration(FreemarkerDocumentFormatter.java:181)
    at fr.opensagres.xdocreport.template.freemarker.FreemarkerTemplateEngine.setConfiguration(FreemarkerTemplateEngine.java:267)
    at fr.opensagres.xdocreport.document.docx.discovery.DocxTemplateEngineInitializerConfigurationDiscovery.initialize(DocxTemplateEngineInitializerConfigurationDiscovery.java:53)
    at fr.opensagres.xdocreport.document.registry.TemplateEngineInitializerRegistry.onEndInitialization(TemplateEngineInitializerRegistry.java:180)
    at fr.opensagres.xdocreport.core.registry.AbstractRegistry.initializeIfNeeded(AbstractRegistry.java:87)
    at fr.opensagres.xdocreport.document.registry.TemplateEngineInitializerRegistry.getTemplateEngine(TemplateEngineInitializerRegistry.java:84)
    at fr.opensagres.xdocreport.document.registry.XDocReportRegistry.loadReport(XDocReportRegistry.java:339)
    at fr.opensagres.xdocreport.document.registry.XDocReportRegistry.loadReport(XDocReportRegistry.java:317)
    at fr.opensagres.xdocreport.document.registry.XDocReportRegistry.loadReport(XDocReportRegistry.java:302)
    at be.cegeka.batchers.taxcalculator.application.domain.pdf.PDFGeneratorService.generatePdfAsByteArray(PDFGeneratorService.java:23)
    at be.cegeka.batchers.taxcalculator.batch.processor.SendPaycheckProcessor.process(SendPaycheckProcessor.java:45)
    at be.cegeka.batchers.taxcalculator.batch.processor.SendPaycheckProcessor.process(SendPaycheckProcessor.java:22)
    at be.cegeka.batchers.taxcalculator.batch.processor.SendPaycheckProcessor$$FastClassBySpringCGLIB$$d1bb28a4.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:711)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644)
    at be.cegeka.batchers.taxcalculator.batch.processor.SendPaycheckProcessor$$EnhancerBySpringCGLIB$$d3a8142e.process(<generated>)
    at org.springframework.batch.item.support.CompositeItemProcessor.processItem(CompositeItemProcessor.java:61)
    at org.springframework.batch.item.support.CompositeItemProcessor.process(CompositeItemProcessor.java:50)
    at org.springframework.batch.core.step.item.SimpleChunkProcessor.doProcess(SimpleChunkProcessor.java:126)
    at org.springframework.batch.core.step.item.FaultTolerantChunkProcessor$1.doWithRetry(FaultTolerantChunkProcessor.java:225)
    at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:263)
    ... 12 more
2014-06-04 22:28:47,132 INFO   [SimpleJobLauncher] Job: [SimpleJob: [name=employeeJob]] completed with the following parameters: [{month=1, year=2014}] and the following status: [FAILED] 
![bug-1](https://cloud.githubusercontent.com/assets/567842/3179614/2690cf70-ec28-11e3-819a-aaa4a8b47c4e.png)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions