Announcement Announcement Module
No announcement yet.
Scope 'step' is not active for the current thread Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Scope 'step' is not active for the current thread

    I am trying to use "org.springframework.batch.integration.async.Async ItemProcessor" to make Processor multithreading. I am passing as a "delegate" my own service/bean.
    If I declare that bean in scope "step". I get the following exception (below):
    I am attaching job description xml and the my service/bean that acts as a "delegate"


    org.springframework.batch.retry.ExhaustedRetryExce ption: Retry exhausted after last attempt in recovery path, but exception is not skippable.; nested exception is java.util.concurrent.ExecutionException: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'scopedTarget.marcLocalCSIProcessor': Scope 'step' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No context holder available for step scope
    at org.springframework.batch.core.step.item.FaultTole rantChunkProcessor$5.recover(FaultTolerantChunkPro
    at ate.handleRetryExhausted(
    at ate.doExecute(
    at ate.execute(
    at org.springframework.batch.core.step.item.BatchRetr yTemplate.execute(
    at org.springframework.batch.core.step.item.FaultTole rantChunkProcessor.write(FaultTolerantChunkProcess
    at org.springframework.batch.core.step.item.SimpleChu nkProcessor.process(
    at org.springframework.batch.core.step.item.ChunkOrie ntedTasklet.execute(
    at org.springframework.batch.core.step.tasklet.Taskle tStep$ChunkTransactionCallback.doInTransaction(Tas
    at nTemplate.execute(
    at org.springframework.batch.core.step.tasklet.Taskle tStep$2.doInChunkContext(
    at org.springframework.batch.core.scope.context.StepC ontextRepeatCallback.doInIteration(StepContextRepe
    at plate.getNextResult(
    at plate.executeInternal(
    at plate.iterate(
    at org.springframework.batch.core.step.tasklet.Taskle tStep.doExecute(
    at org.springframework.batch.core.step.AbstractStep.e xecute(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native
    at sun.reflect.DelegatingMethod