That worked. Thank you for your help!
I'm having another problem with something that seems to have changed from v1 to 2.0. We've got some old config files that have something like this:
Code:
<bean id="invalidFinDataWriter" class="org.springframework.batch.item.file.FlatFileItemWriter" scope="step">
<property name="resource" ref="file:/#{jobParameters[invalidDir]}/#{jobParameters[invalidFileName]}" />
<property name="fieldSetCreator">
<bean class="org.springframework.batch.item.file.mapping.PassThroughFieldSetMapper"/>
</property>
</bean>
<bean id="pubFinIdItemReader" class="org.springframework.batch.item.file.FlatFileItemReader" scope="step">
<property name="resource" value="file:/#{jobParameters[srcDir]}/#{jobParameters[fileName]}" />
<property name="lineMapper">
<bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper">
<property name="lineTokenizer">
<bean class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer">
<property name="delimiter" value="|"/>
<property name="names" value="publ_id,fin_id" />
</bean>
</property>
<property name="fieldSetMapper">
<bean class="com.me.batch.mapping.PubFinIdDataMapping" >
<property name="invalidFinDataWriter" ref="invalidFinDataWriter" />
</bean>
</property>
</bean>
</property>
</bean>
The part I'm having trouble with is passing invalidFinDataWriter into my class PubFinIdDataMapping. That class contains:
Code:
public void setInvalidFinDataWriter (FlatFileItemWriter invalidFinDataWriter){
this.invalidFinDataWriter = invalidFinDataWriter;
}
When I do this, I get the exception:
Code:
java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy16 implementing org.springframework.batch.item.file.ResourceAwareItemWriterItemStream,org.springframework.beans.factory.InitializingBean,org.springframework.aop.scope.ScopedObject,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised,java.io.Serializable] to required type [org.springframework.batch.item.file.FlatFileItemWriter]: no matching editors or conversion strategy found
I cribbed this code from an existing set we have in production running on spring batch 1.1, so I'm fairly certain this should work. Any ideas?