I am using Spring Boot Batch Example. In this example I am using the PartitionedRange.

While executing the batch job I am getting the below error. The Spring Boot version 2.0.3.RELEASE. Please let me know if need any other??

Not sure why this is causing the issues? 

The error which is getting here

```
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'scopedTarget.slaveWriter' defined in class path resource [com/prateek/job/PaymentsPartitionerJob.class]: Unsatisfied dependency expressed through method 'slaveWriter' parameter 1; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1021E: A problem occurred whilst attempting to access the property 'stepExecutioUsertext': 'Invalid property 'stepExecutioUsertext' of bean class [org.springframework.batch.core.scope.context.StepContext]: Bean property 'stepExecutioUsertext' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?'
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:729) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:470) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1254) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1103) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:541) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$1(AbstractBeanFactory.java:353) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.batch.core.scope.StepScope.get(StepScope.java:113) ~[spring-batch-core-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:350) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35) ~[spring-aop-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:672) ~[spring-aop-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.batch.item.file.FlatFileItemWriter$$EnhancerBySpringCGLIB$$c7405dad.open(<generated>) ~[spring-batch-infrastructure-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.batch.item.support.CompositeItemStream.open(CompositeItemStream.java:103) ~[spring-batch-infrastructure-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.batch.core.step.tasklet.TaskletStep.open(TaskletStep.java:310) ~[spring-batch-core-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:197) ~[spring-batch-core-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler$1.call(TaskExecutorPartitionHandler.java:139) [spring-batch-core-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler$1.call(TaskExecutorPartitionHandler.java:136) [spring-batch-core-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_171]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171]
Caused by: org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1021E: A problem occurred whilst attempting to access the property 'stepExecutioUsertext': 'Invalid property 'stepExecutioUsertext' of bean class [org.springframework.batch.core.scope.context.StepContext]: Bean property 'stepExecutioUsertext' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?'
    at org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:164) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.evaluateBeanDefinitionString(AbstractBeanFactory.java:1452) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1088) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:815) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:721) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    ... 19 common frames omitted
Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1021E: A problem occurred whilst attempting to access the property 'stepExecutioUsertext': 'Invalid property 'stepExecutioUsertext' of bean class [org.springframework.batch.core.scope.context.StepContext]: Bean property 'stepExecutioUsertext' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?'
    at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:209) ~[spring-expression-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:104) ~[spring-expression-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:91) ~[spring-expression-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.expression.spel.ast.CompoundExpression.getValueRef(CompoundExpression.java:52) ~[spring-expression-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:88) ~[spring-expression-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:111) ~[spring-expression-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:270) ~[spring-expression-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:161) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    ... 24 common frames omitted

```

**PaymentsPartitionerJob.java**

```
@Slf4j
@Configuration
@EnableBatchProcessing
public class PaymentsPartitionerJob {
    @Autowired
    private JobBuilderFactory jobBuilderFactory;

    @Autowired
    private StepBuilderFactory stepBuilderFactory;

    @Autowired
    private DataSource dataSource;

    @Bean
    public SimpleAsyncTaskExecutor taskExecutor() {
        return new SimpleAsyncTaskExecutor();
    }

    @Bean
    public RangePartitioner rangePartitioner() {
        return new RangePartitioner();
    }

    @Bean
    public PaymentsTasklet paymentsTasklet() {
        return new PaymentsTasklet();
    }

    @Bean
    @StepScope
    public PaymentProcessor slaveProcessor(@Value("#{stepExecutionContext[name]}") String name) {
        log.info("********called slave processor **********");
        PaymentProcessor paymentProcessor = new PaymentProcessor();
        paymentProcessor.setThreadName(name);
        return paymentProcessor;
    }

    @Bean
    @StepScope
    public FlatFileItemWriter<Payments> slaveWriter(@Value("#{stepExecutionContext[fromId]}") final String fromId,
            @Value("#{stepExecutioUsertext[toId]}") final String toId){

        FlatFileItemWriter<Payments> reader = new FlatFileItemWriter<>();
        reader.setResource(new FileSystemResource("csv//payments.processed"+ fromId+"-"+toId+".csv"));

        BeanWrapperFieldExtractor<Payments> fieldExtractor = new BeanWrapperFieldExtractor<>();
        fieldExtractor.setNames(new String[] {"customerNumber", "checkNumber", "paymentDate", "amount"});

        DelimitedLineAggregator<Payments> lineAggregator = new DelimitedLineAggregator<>();
        lineAggregator.setDelimiter(",");
        lineAggregator.setFieldExtractor(fieldExtractor);

        return reader;
    }

    @Bean
    @StepScope
    public JdbcPagingItemReader<Payments> slaveReader(@Value("#{stepExecutionContext[fromId]}") final String fromId,
            @Value("#{stepExecutionContext[toId]}") final String toId,
            @Value("#{stepExecutionContext[name]}") final String name) {

        // Bean Property Row Mapper
        BeanPropertyRowMapper<Payments> propertyRowMapper = new BeanPropertyRowMapper<>();
        propertyRowMapper.setMappedClass(Payments.class);

        log.info("slaveReader start " + fromId + " " + toId);

        // Jdbc Paging Item Reader
        JdbcPagingItemReader<Payments> reader = new JdbcPagingItemReader<>();
        reader.setDataSource(dataSource);
        reader.setQueryProvider(queryProvider());

        // Set the Parameter values
        Map<String, Object> parameterValues = new HashMap<>();
        parameterValues.put("fromId", fromId);
        parameterValues.put("toId", toId);
        log.info("Parameter Value " + name + " " + parameterValues);

        reader.setParameterValues(parameterValues);
        reader.setPageSize(1000);
        reader.setRowMapper(propertyRowMapper);
        return reader;
    }

    private PagingQueryProvider queryProvider() {
        log.info("queryProvider start ");
        SqlPagingQueryProviderFactoryBean provider = new SqlPagingQueryProviderFactoryBean();
        provider.setDataSource(dataSource);
        provider.setSelectClause("SELECT customerNumber, checkNumber, paymentDate, amount ");
        provider.setFromClause("FROM payments ");
        provider.setWhereClause("WHERE customerNumber >= :fromId AND fromId <= :toId ");
        provider.setSortKey("customerNumber");
        try {
            return provider.getObject();
        } catch (Exception e) {
            log.error("ERROR IN queryProvider() "+e.getMessage());
        }
        return null;
    }

    @Bean(name = "slave")
    public Step slave() {
        log.info("...........called slave .........");
        return stepBuilderFactory.get("slave").<Payments, Payments>chunk(100)
                .reader(slaveReader(null, null, null))
                .processor(slaveProcessor(null))
                .writer(slaveWriter(null, null))
                .build();
    }

    @Bean
    public PartitionHandler masterSlaveHandler() {
        TaskExecutorPartitionHandler handler = new TaskExecutorPartitionHandler();
        handler.setGridSize(10);
        handler.setTaskExecutor(taskExecutor());
        handler.setStep(slave());
        try {
            handler.afterPropertiesSet();
        } catch (Exception e) {
            log.error("masterSlaveHandler :: "+e.getMessage());
        }
        return handler;
    }

    @Bean
    public Step masterStep() {
        return stepBuilderFactory.get("masterStep")
                .partitioner(slave().getName(), rangePartitioner())
                .partitionHandler(masterSlaveHandler())
                .build();
    }

    @Bean
    public Step step2() {
        return stepBuilderFactory.get("step2").tasklet(paymentsTasklet()).build();
    }

    @Bean
    public Job PartitionJob() {
        return jobBuilderFactory
                .get("partitionJob")
                .incrementer(new RunIdIncrementer())
                .start(masterStep())
                .next(step2())
                .build();
    }
}

```