Results 1 to 3 of 3

Thread: Remote Chunking scope="step" dependencies on remote slaves

  1. #1
    Join Date
    Feb 2006
    Posts
    7

    Default 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. #2
    Join Date
    Feb 2006
    Posts
    7

    Default

    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;

  3. #3
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    338

    Default

    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!
    Michael Minella
    Spring Batch Lead
    Author - Pro Spring Batch
    http://www.michaelminella.com
    Twitter: @MichaelMinella

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •