Announcement Announcement Module
Collapse
No announcement yet.
JobParametersIncrementer and scope step Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JobParametersIncrementer and scope step

    Hello,

    i hope to have a answer

    I have another problem. in command line i define some parameter.

    Code:
    org.springframework.batch.core.launch.support.CommandLineJobRunner -next start.date=20120101
    I try to retrieve this parameter in my bean JobParameterIncrementer in order to init my job incrementer.

    like this

    Code:
    public class JobParametersIncrementer extends AbstractLoopJobParametersIncrementer {
    
    	@Value("#{jobParameters['start.date']}")
    	private String startDate;
    
            private Calendar date;
    
            @PostConstruct
            void init(){
                date = new SimpleDateFormat("yyyyMMdd").parse(startDate);
            }
    ...
    }

    but i have this error.

    Code:
     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'
    How to retrieve the initial job parameter in incremeter?
Working...
X