hi
the config is as follows. I have tried to get the code in the job and step format. The name of my xml is multiResourceJob.xml. I have not made only minor changes to the example code.
Code
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/batch"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xmlns:task="http://www.springframework.org/schema/task" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/batch
http://www.springframework.org/schema/batch/spring-batch-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<job id="multiResourceJob" restartable="false">
<step id="fileStep1">
<tasklet ref="multiResourceReader" transaction-manager="transactionManager" />
</step>
</job>
<beans:bean id="multiResourceReader" class="org.springframework.batch.item.file.MultiResourceItemReader">
<beans:property name="resources" value="classpath:delimited*.csv" />
<beans:property name="delegate" ref="flatFileItemReader" />
</beans:bean>
<beans:bean id ="flatFileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader">
<beans:property name="lineMapper">
<beans:bean
class="org.springframework.batch.item.file.mapping.DefaultLineMapper">
<beans:property name="lineTokenizer">
<beans:bean
class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer">
<beans:property name="delimiter" value="," />
<beans:property name="names" value="name,credit" />
</beans:bean>
</beans:property>
<beans:property name="fieldSetMapper">
<beans:bean class="org.springframework.batch.item.file.mapping.BeanWrapperFieldSetMapper">
<beans:property name="targetType" value="abc.patni.com.CustomerCredit" />
</beans:bean>
</beans:property>
</beans:bean>
</beans:property>
</beans:bean>