This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

That chapter 11 is a little out of date, but it never would have worked to inject an ApplicationContext in @BeforeStep anyway. Easier by far is to use scope="step" for your components and simply inject the stepExecution using a late binding expression (see chapter 5 http://static.springsource.org/sprin...l#late-binding).

Comment

Thanks for the reply. Actually, the injection of the ApplicationContext works. The saveStepExecution method does not. I need the application context so I can instantiate the bean for accessing my database. So that parts works ok and I can retrieve the application startup values I need.

I guess I will keep reading the section on late binding until I get it.

This first step does need to be restartable. In fact I made a change so it will get run each time job runs, regardless of its completion status. It just retrieves a few date values from the database that are then used in the next step for every row that it retrieves.

I was hoping the ChunkContext could supply me with the jobExecutionContext so I could put these values directly in. Then the item processor in the next step could retrieve those values from the that context without needing to access the database again.