I am trying to use the PrefixMatchingCompositeLineTokenizer based off the multi line job sample in Spring Batch 1.1.4
It appears that my column definition is not being interpreted. I have tried to base this off the sample though.
I get the following error.
Cannot resolve reference to bean 'accountRecordTokenizer' while setting bean property 'tokenizers' with key [TypedStringValue: value [Account_Rec ], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating
bean with name 'accountRecordTokenizer' defined in class path resource [multiLineTest.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException:Fa iled to convert property value of type [java.lang.String] to required type [org.springframework.batch.item.file.transform.Rang e[]] for property 'columns'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.springframework.batch.item.file.transform.Rang e] for property 'columns[0]': no matching editors or conversion strategy found at org.springframework.beans.factory.support.BeanDefi nitionValueResolver
.resolveInnerBean BeanDefinitionValueResolver.java:230)............. .............
The relevant sections of my Spring batch job fileCode:<bean id="fixedFileDescriptor" class="org.springframework.batch.item.file.transform.PrefixMatchingCompositeLineTokenizer"> <property name="tokenizers"> <map> <entry key="Account_Rec " value-ref="accountRecordTokenizer" /> <entry key="Customer_Rec " value-ref="customerRecordTokenizer" /> </map> </property> </bean> <bean id="accountRecordTokenizer" class="org.springframework.batch.item.file.transform.FixedLengthTokenizer"> <property name="names" value="Account_No,Extract_Date,Acct_Status,Record_Type,Prod_Code,Stmnt_Freq,Remainder" /> <property name="columns" value="1-12, 13-22, 23, 24, 25-27, 28-30, 31-" /> <!-- <property name="strict" value="false"/> --> </bean>
Any ideas where I am going wrong?
Regards
Andrew


Reply With Quote