Hi,
I'm trying to inject the filename from jobParameters into a custom MultiItemResourceReader at step scope.
I'm getting this error :
here is my xml configCode:Caused by: java.lang.IllegalStateException: Cannot convert value of type [$Proxy10 implementing org.springframework.batch.item.ItemReader,org.springframework.batch.item.ItemStream,org.springframework.aop.scope.ScopedObject,java.io.Serializable,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [xxx.xxx.itemReaders.CustomeMultiResourceReader] for property 'resource': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231) at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:447)
It works perfectly fine for the decompressTasklet but not for the multiResourceReaderUn.Code:<batch:step id="decompress" next="readWriteUnmatched"> <batch:tasklet ref="decompressTasklet" /> </batch:step> <batch:step id="readWriteUnmatched" next="readWriteMatched"> <batch:tasklet> <batch:chunk reader="multiResourcesReaderUn" processor="unmatchedProcessor" writer="unmatchedWriter" commit-interval="1" skip-limit="99999"> <batch:skippable-exception-classes> <batch:include class="java.lang.Exception"/> </batch:skippable-exception-classes> </batch:chunk> </batch:tasklet> <batch:listeners> <batch:listener ref="unmatchedSkipListener"/> <batch:listener ref="unmatchedFileChangeListener"/> </batch:listeners> </batch:step> <bean id="decompressTasklet" class="xxx.xxx.DecompressTasklet" scope="step"> <property name="inputResource" value="file:///#{jobParameters['inputResource']}" /> <property name="targetDirectory" value="#{jobParameters['targetDirectory']}" /> </bean> <bean id="multiResourcesReaderUn" class="xxx.xxx.itemReaders.CustomeMultiResourceReader" scope="step" > <constructor-arg ref="dataSource"/> <property name="archiveFile" value="#{jobParameters['inputResource']}"/> <property name="resources" value="file:///C:/output/*_UNMATCHED.csv" /> <property name="delegate" ref="flatFileItemReaderUnmatched"/> </bean>
Any help would be appreciated.


Reply With Quote
