Dear Members
I am working with spring-batch-2.1.0.RELEASE
I have the follow
in my Java code I haveCode:<?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/batch" xmlns:util="http://www.springframework.org/schema/util" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd" > ... <job job-repository="jobRepository" id="insertIntoDbFromCsvJob"> <step id="step1"> <tasklet transaction-manager="transactionManager" > <chunk reader="csvFileReader" processor = "userRegistrationValidationProcessor" .... ... </job> <beans:bean scope="step" id="csvFileReader" class="org.springframework.batch.item.file.FlatFileItemReader" p:resource="file:D:/batches/#{jobParameters[input.fileName]}.csv"> <beans:property name="lineMapper">
I can compile fine, and when I run the code I don't receive any error or exception, the problem is that bean "csvFileReader" not work, I know this because no insertion in the DB happen and my expected output log values not appear, even if I use a non-exist or invalid value for p:resource none error appearCode:jobLauncher.run(job, new JobParametersBuilder().addDate("date", new Date()) .addString("input.fileName","registrations").toJobParameters());
But If I only change to this instead
All work fineCode:<beans:bean id="csvFileReader" class="org.springframework.batch.item.file.FlatFileItemReader" p:resource="file:D:/batches/registrations.csv"> <beans:property name="lineMapper">
Therefore what is missing?
Thanks in advanced
-Manuel


Reply With Quote
