This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Remote Chunking scope="step" dependencies on remote slaves

Feb 6th, 2013, 11:08 AM

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)

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

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