Results 1 to 2 of 2

Thread: Problem with jobParameter in xml configuration file

  1. #1
    Join Date
    May 2010
    Posts
    2

    Question [Resolved] Problem with jobParameter in xml configuration file

    Hi everyone,

    I'm facing a strange problem in my spring batch application.
    It seems I've made a misoncifugration as I can't use #{jobParameters} in my app since I got this exception :
    Code:
    Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Field or property 'jobParameters' cannot be found on object of type 'org.springframework.beans.factory.config.BeanExpressionContext'
    	at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:206)
    	at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:71)
    	at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:52)
    	at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93)
    	at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:88)
    	at org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:137)
    	... 52 more
    Is there a special BeanPostProcessor or something to configure to make this work ?
    Last edited by Mektoub; May 19th, 2010 at 06:59 AM.

  2. #2
    Join Date
    May 2010
    Posts
    2

    Default

    Ok I fount out my mistake.

    In the bean declaration, where I was using the jobParameter to set a property, I forgot tu set the attribute scope="step" as in the example below :

    Code:
    <bean id="myReader" class="MyItemReader" scope="step">
    	<property name="parameter" value="#{jobParameters['myParameter']}" />
    </bean>

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
  •