1

We are using partitioner and it is annotated with @Scope(value="step") and has setter method which is annotated with @BeforeStep, but still framewowrk does not inject step execution object?

What we are doing wrong

user509755
  • 2,941
  • 10
  • 48
  • 82
  • What so you want to do? the partitioner creates (step-) executions, it makes no sense (for me) to participate in a step lifecycle – Michael Pralow Aug 23 '15 at 07:27

1 Answers1

2

Did you register the partitioner as "listener" on the step? As soon as you are using Step-Scope, your Bean is hidden behind a proxy, which makes it impossible for spring to register it automatically as a step-listener (it should work if your bean is not "step-scoped").

It is explained here: Spring-batch @BeforeStep does not work with @StepScope

Community
  • 1
  • 1
Hansjoerg Wingeier
  • 4,274
  • 4
  • 17
  • 25