I read SO related questions but the solutions don\'t work for me.
I get the org.springframework.batch.item.ReaderNotOpenException: Reader must be open before i
The method I defined is like below:
@Bean
@StepScope
public ItemReader BPReader(){
JdbcCursorItemReader itemReader = new JdbcCursorItemReader();
...
return itemReader;
}
The type I defined in the method is ItemReader which is an interface, the return type is JdbcCursorItemReader which is a sub-class of it. By changing the return type defination to JdbcCursorItemReader solved my problem