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

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

    Hi,
    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"

    Thanks,
    Tanya.

    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 cessor.java:380)
    at org.springframework.batch.retry.support.RetryTempl ate.handleRetryExhausted(RetryTemplate.java:414)
    at org.springframework.batch.retry.support.RetryTempl ate.doExecute(RetryTemplate.java:283)
    at org.springframework.batch.retry.support.RetryTempl ate.execute(RetryTemplate.java:187)
    at org.springframework.batch.core.step.item.BatchRetr yTemplate.execute(BatchRetryTemplate.java:213)
    at org.springframework.batch.core.step.item.FaultTole rantChunkProcessor.write(FaultTolerantChunkProcess or.java:393)
    at org.springframework.batch.core.step.item.SimpleChu nkProcessor.process(SimpleChunkProcessor.java:194)
    at org.springframework.batch.core.step.item.ChunkOrie ntedTasklet.execute(ChunkOrientedTasklet.java:74)
    at org.springframework.batch.core.step.tasklet.Taskle tStep$ChunkTransactionCallback.doInTransaction(Tas kletStep.java:358)
    at org.springframework.transaction.support.Transactio nTemplate.execute(TransactionTemplate.java:130)
    at org.springframework.batch.core.step.tasklet.Taskle tStep$2.doInChunkContext(TaskletStep.java:261)
    at org.springframework.batch.core.scope.context.StepC ontextRepeatCallback.doInIteration(StepContextRepe atCallback.java:76)
    at org.springframework.batch.repeat.support.RepeatTem plate.getNextResult(RepeatTemplate.java:367)
    at org.springframework.batch.repeat.support.RepeatTem plate.executeInternal(RepeatTemplate.java:214)
    at org.springframework.batch.repeat.support.RepeatTem plate.iterate(RepeatTemplate.java:143)
    at org.springframework.batch.core.step.tasklet.Taskle tStep.doExecute(TaskletStep.java:247)
    at org.springframework.batch.core.step.AbstractStep.e xecute(AbstractStep.java:196)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethod
Working...
X