Code:<step id="testStep"> <tasklet ref="testBean2"/> </step>Code:<bean id="testBean2" class="com.investmaster.util.batch.reader.BatchReaderServersideExecution"> </bean>When I run the job the log trace does actually output:Code:package com.investmaster.util.batch.reader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class BatchReaderServersideExecution { private static final Logger LOG = LoggerFactory.getLogger(BatchReaderServersideExecution.class); public BatchReaderServersideExecution() { LOG.info("Inside BatchReaderServersideExecution.. will execute oracle functions inside this class.."); } }
13:34:20.533 [main] INFO c.i.u.b.r.BatchReaderServersideExecution - Inside BatchReaderServersideExecution.. will execute oracle functions inside this class..
But it crashes with this exception:
Can someone help me correct this please?Code:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testStep': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.investmaster.util.batch.reader.BatchReaderServersideExecution] to required type [org.springframework.batch.core.step.tasklet.Tasklet] for property 'tasklet'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.investmaster.util.batch.reader.BatchReaderServersideExecution] to required type [org.springframework.batch.core.step.tasklet.Tasklet] for property 'tasklet': no matching editors or conversion strategy found at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
Many thanks.


Reply With Quote