Announcement Announcement Module
No announcement yet.
Bug in AsyncItemProcessor. Can not use scope step. Scope 'step' is not active except. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bug in AsyncItemProcessor. Can not use scope step. Scope 'step' is not active except.

    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

  • #2
    Not sure I would call that a bug (missing feature maybe), but you are right that we could take care of it in the framework. You could raise a JIRA issue.


    • #3
      Can not find code changes for BATCHADM-81 JIRA

      I can not find source code changes for the BATCHADM-81 JIRA. could you, please, send the URL for the source code?

      Thank you,