Announcement Announcement Module
Collapse
No announcement yet.
Problem with jobParameter in xml configuration file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 07:59 AM.

  • #2
    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>

    Comment


    • #3
      Originally posted by Mektoub View Post
      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>
      Awesome, it worked for me as well.

      Comment


      • #4
        It worked for me too !!!
        Thanks so much.
        I was trying to find the solution for hours!

        Comment

        Working...
        X