Announcement Announcement Module
Collapse
No announcement yet.
Remote Chunking scope="step" dependencies on remote slaves Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Remote Chunking scope="step" dependencies on remote slaves

    Currently we are trying to implement Remote Chunking and the processor/writer that is implemented to run on slave nodes has scope="step" dependency. This is causing the exception as the following. I'am wondering if any one has any suggestion to how to resolve this.

    Exception :

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'scopedTarget.updatePositionSchedule': 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.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:339 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:190)

    Related slave node configuration.

    <bean id="slaveChunkHandler" class="org.springframework.batch.integration.chunk .ChunkProcessorChunkHandler">
    <property name="chunkProcessor" >
    <bean class="org.springframework.batch.core.step.item.Si mpleChunkProcessor">
    <property name="itemWriter" ref="PositionItemWriter"/>
    <property name="itemProcessor">
    <bean class="org.springframework.batch.item.support.Pass ThroughItemProcessor"/>
    </property>
    </bean>
    </property>
    </bean>

    <bean id="PositionItemWriter"
    class="org.springframework.batch.item.support.Comp ositeItemWriter">
    <property name="delegates">
    <list>
    <ref bean="updatePositionSchedule"/>
    </list>
    </property>
    </bean>

    <bean id="updatePositionSchedule" scope="step"
    class="com.xyz.batch.writer.PositionScheduleItemWr iter">
    <property name="calcRequest" value="#{jobExecutionContext['calcRequest']}"/>
    </bean>

  • #2
    Any one has any solution for this issue?
    I also see that in RemoteChunkHandlerFactoryBean.java has the following comment on line no:142
    Is there any plan to provide the implementation in this class to create step context for the processor in case it has scope="step" dependencies? I think that would resolve this step scope issue java.lang.IllegalStateException: No context holder available for step scope

    ChunkProcessorChunkHandler<T> handler = new ChunkProcessorChunkHandler<T>();
    setNonBuffering(chunkProcessor);
    handler.setChunkProcessor(chunkProcessor);
    // TODO: create step context for the processor in case it has
    // scope="step" dependencies

    handler.afterPropertiesSet();

    return handler;

    Comment


    • #3
      Your comment on that note is correct in that the framework currently does not support the injection of remote step scoped dependencies. I did a quick search for a Jira item related to that and did not find one so I created it. You can follow it's progress here: https://jira.springsource.org/browse/BATCHADM-148

      As always, contributions are happily accepted!

      Comment


      • #4
        Currently, I still don't see any enhancement for the injection of remote step scoped dependencies in latest releases.
        I am wondering if there is any plan to resolve this in near future.

        Comment


        • #5
          Hi, Is there any plan to support the injection of remote step scoped dependencies.

          Comment

          Working...
          X