Hi, first of all, sorry for my english, I'm using a translator.
I am trying to configure a bean with scope = "step" and get the following error:
Caused by: java.lang.IllegalStateException: No Scope registered for scope 'step'
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:322 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:322)
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:106)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:517)
... 51 more
My Spring configuration is:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:batch="http://www.springframework.org/schema/batch"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-3.0.xsd
http://www.springframework.org/schema/batch http://www.springframework.org/schem...-batch-2.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schem...ng-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
............
<bean id="AbstractStep" class="org.springframework.batch.core.step.Abstrac tStep" abstract="true">
<property name="jobRepository" ref="jobRepository" />
</bean>
<batch:job id="mailProcess" job-repository="jobRepository">
<batch:step id="filter1" parent="AbstractStep">
<batch:tasklet transaction-manager="jobTrxManager">
<batch:chunk reader="mailReader" writer="mailWriter" commit-interval="1"/>
</batch:tasklet>
</batch:step>
</batch:job>
........
<bean id="mailReader" class="uy.com.geocom.mail2mantis.mail2mantis_core. jobs.MailReader" scope="step"/>
........
</beans>
I have tried to resolve this problem adding the line:
<bean class="org.springframework.batch.core.scope.StepSc ope" />
but did not solve the problem
I also tried to explicitly register the scope
<bean class="org.springframework.beans.factory.config.Cu stomScopeConfigurer">
<property name="scopes">
<map>
<entry key="step">
<bean class="org.springframework.batch.core.scope.StepSc ope" />
</entry>
</map>
</property>
</bean>
Really do not know what else to do. Any help you can give me will be greatly appreciated.
Thank you very much


Reply With Quote