1

I have one step configurations as below

stepBuilderFactory.get("step2")
                .<EventLogWrapper, BaseCscEvent>chunk(100)
                .reader(eventLogReader)
                .processor(eventLogItemProcessor)
                .writer(compositeItemWriter)
                .faultTolerant().retryLimit(10).retry(Exception.class)
                .stream(dataBaseItemWriter)
                .stream(rabbitAmqpItemWriter)
                .taskExecutor(taskExecutor())
                .build();

My Reader configuration is as below

 AmqpItemReader<EventLog> eventLogReader(AmqpTemplate eventLogReaderRabbitTemplate){

     AmqpItemReader amqpItemReader = new AmqpItemReader<EventLog>(eventLogReaderRabbitTemplate);
     amqpItemReader.setItemType(EventLogWrapper.class);
     return amqpItemReader;

 }

I am getting one intermittent error as below

ExitMessage org.springframework.retry.RetryException: Non-skippable exception in recoverer while processing; nested exception is java.lang.NullPointerException at org.springframework.batch.core.step.item.FaultTolerantChunkProcessor$2.recover(FaultTolerantChunkProcessor.java:289) at org.springframework.retry.support.RetryTemplate.handleRetryExhausted(RetryTemplate.java:512) at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:351) at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:211) at org.springframework.batch.core.step.item.BatchRetryTemplate.execute(BatchRetryTemplate.java:217) at org.springframework.batch.core.step.item.FaultTolerantChunkProcessor.transform(FaultTolerantChunkProcessor.java:298) at org.springframework.batch.core.step.item.SimpleChunkProcessor.process(SimpleChunkProcessor.java:210) at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:77) at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:407) at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:331) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:273) at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:82) at org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate$ExecutingRunnable.run(TaskExecutorRepeatTemplate.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NullPointerException
What is the reason behind this behavior ?

What should I do to resolve this ?

Thanks for reading!

  • 1
    Please add full stack-trace. It seems you are getting `NullPointerException` in your item processor. – Binu Feb 20 '20 at 08:20
  • The above is the full stack-trace as the call did not reach item Processor. I am not able to repro the issue as well now. any idea how can i repro the issue? – Chetanti Mehta Feb 20 '20 at 12:15

0 Answers0