Announcement Announcement Module
Collapse
No announcement yet.
ItemWriter issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ItemWriter issue

    Hi,

    I am reading a list of object from webservice using a customized reader and writing at in the file.


    The source code is

    <bean id="ABSUpload_RecurringPaymentJob" parent="simpleJob">
    <property name="steps">
    <list>
    <bean id="LoadtheDailyTransactionData" parent="simpleStep">
    <property name="itemReader">
    <bean id="customItemReader"
    class="com.healthnet.ibilling.dao.RecurringPayment SetUpChangeReader">
    </bean>
    </property>

    <property name="itemWriter">
    <bean class="org.springframework.batch.item.file.FlatFil eItemWriter">
    <property name="resource" value="file:C:/20070122.testStream.multilineStep.txt" />
    <property name="fieldSetCreator">
    <bean class="com.healthnet.ibilling.dao.CustomFieldSetMa pper"/>
    </property>
    <property name="lineAggregator" ref="fixedLengthLineAggregator"/>
    </bean>
    </property>
    </bean>
    </list>
    </property>
    </bean>

    <bean id="fixedLengthLineAggregator" class="org.springframework.batch.item.file.transfo rm.FixedLengthLineAggregator">
    <property name="columns" value="1-7,8-18,19-29,30-41"/>
    </bean>

    I am getting the following exception:

    Job Terminated in error:
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'ABSUpload_RecurringPaymentJob' defined in class path resource [Grp_West_ABSUpload_RecurringPaymentJob.xml]: Cannot create inner bean 'LoadtheDailyTransactionData' of type [org.springframework.batch.core.step.item.SimpleSte pFactoryBean] while setting bean property 'steps' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'LoadtheDailyTransactionData' defined in class path resource [Grp_West_ABSUpload_RecurringPaymentJob.xml]: Cannot create inner bean 'org.springframework.batch.item.file.FlatFileItemW riter#1afb0c7' of type [org.springframework.batch.item.file.FlatFileItemWr iter] while setting bean property 'itemWriter'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.batch.item.file.FlatFileItemW riter#1afb0c7' defined in class path resource [Grp_West_ABSUpload_RecurringPaymentJob.xml]: Cannot resolve reference to bean 'fixedLengthLineAggregator' while setting bean property 'lineAggregator'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'fixedLengthLineAggregator' defined in class path resource [Grp_West_ABSUpload_RecurringPaymentJob.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed 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(BeanDefinitio nValueResolver.java:230)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:117)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveManagedList(BeanDefinit ionValueResolver.java:287)

    someone please help me in this

  • #2
    I am using Spring Batch 1.0 version

    Comment


    • #3
      See my response in this thread: http://forum.springsource.org/showthread.php?t=73311

      Comment

      Working...
      X