我正在 SpringBatch 中使用带有 FixedLengthTokenizer 的 FlatFileItemReader 来从文本文件中读取并保存到 xml 文件中。我收到一个错误:Bean 属性 'fixedLengthTokenizer' 不可写或具有无效的 setter 方法。setter 的参数类型是否与 getter 的返回类型匹配?(我会放孔控制台日志)。感谢您的任何帮助 。配置文件:spring-batch-context.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:batch="http://www.springframework.org/schema/batch"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/batch
http://www.springframework.org/schema/batch/spring-batch-3.0.xsd">
<bean id="dataSource1" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.OracleDriver"></property>
<property name="url" value="********"></property>
<property name="password" value="*****"></property>
<property name="username" value="******"></property>
</bean>
<bean id="dataSource2" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.OracleDriver"></property>
<property name="url" value="*******"></property>
<property name="password" value="*****"></property>
<property name="username" value="*****"></property>
</bean>
<bean id="flatFileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader" scope="step">
<property name="resource" value="txt/flatfile" />
<property name="lineMapper">
慕慕森
相关分类