Just a little question, I tried to modify the sample XmlFunctionalTests in the spring batch package to make it work with my own xml files
So I modified :
Code:
<bean id="itemReader" class="org.springframework.batch.item.xml.StaxEventItemReader">
<property name="fragmentRootElementName" value="customer" />
<property name="resource" value="data/iosample/input/input.xml" />
<property name="unmarshaller" ref="customerCreditMarshaller" />
</bean>
by
Code:
<bean id="itemReader" class="org.springframework.batch.item.file.MultiResourceItemReader">
<property name="resources" value="data/iosample/input/input*.xml" />
<property name="delegate" ref="xmlItemReader" />
</bean>
<bean id="xmlItemReader" class="org.springframework.batch.item.xml.StaxEventItemReader">
<property name="fragmentRootElementName" value="Cash" />
<property name="unmarshaller" ref="apsysCashMarshaller" />
</bean>
but the file describing the job is
Code:
<job id="ioSampleJob">
<step id="step1">
<tasklet>
<chunk reader="itemReader" writer="itemWriter" commit-interval="6"/>
</tasklet>
</step>
</job>
and of course I get the error :
Code:
NoSuchBeanDefinitionException: No unique bean of type [org.springframework.batch.item.ItemReader] is defined: expected single matching bean but found 2: [itemReader, xmlItemReader]
I have two beans with the same type so the autowire is not possible.
I'm not familiar with xbeans, I'm used to the old notation bean = ...
It is possible to use the previous notation but without autowiring ?