Announcement Announcement Module
Collapse
No announcement yet.
How do i give a Line Tokenizer for a flatfileItemReader in Springbatch 2.0. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do i give a Line Tokenizer for a flatfileItemReader in Springbatch 2.0.

    Unable to give LineTokenizer.Please help



    <bean id="itemReader" class="org.springframework.batch.item.file.FlatFil eItemReader">
    <property name="resource" value="file:./hello.txt" />
    <property name="lineMapper" ref="lineMapper" />
    </bean>
    <bean id="lineMapper"
    class="org.springframework.batch.item.file.mapping .DefaultLineMapper">
    <property name="tokenizer" ref="tokenizer" />
    <property name="fieldSetMapper" ref="fieldSetMapper" />
    </bean>
    <bean id="tokenizer"
    class="org.springframework.batch.item.file.transfo rm.DelimitedLineTokenizer">
    <property name="delimiter" value="H"/>
    </bean>
    <bean id="fieldSetMapper"
    class="org.springframework.batch.item.file.mapping .PassThroughFieldSetMapper" />

  • #2
    Please provide more information. Data, job, error, what you are trying to do ... etc.

    Comment


    • #3
      Am trying to read a flat file which is comma seperated using FlatFileItemReader with the above configuration and write it to another file by replacing commans with spaces.Below Error am getting with LineMapper as there is no LineTokenizer in the FlatfileItemReader 2.0

      org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'itemReader' defined in class path resource [springbatch.xml]: Cannot resolve reference to bean 'lineMapper' while setting bean property 'lineMapper'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'lineMapper' defined in class path resource [springbatch.xml]: Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException : Invalid property 'tokenizer' of bean class [org.springframework.batch.item.file.mapping.Defaul tLineMapper]: No property 'tokenizer' found

      Comment

      Working...
      X