Results 1 to 3 of 3

Thread: No Scope registered for scope 'step'

  1. #1
    Join Date
    Feb 2011
    Posts
    1

    Default No Scope registered for scope 'step'

    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

  2. #2
    Join Date
    Feb 2008
    Posts
    7

    Default No Scope registered for scope 'step'

    Add the below like to your configuration

    <bean class="org.springframework.batch.core.scope.StepSc ope" />

  3. #3
    Join Date
    Jun 2005
    Posts
    4,241

    Default

    Are you using an ApplicationContext? Plain BeanFactory implementations do not automatically run post processors etc. so you would see the same behaviour using XmlBeanFactory for instance.

Posting Permissions

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