这是我的项目表单。
我收到了以下的错误:
java.lang.IllegalStateException: 输入资源必须存在(读取器处于“严格”模式):类路径资源
src
main
ressources
applicationContext.xml
target
upload
pharmacies.txt
这是Spring Batch Reader
<property name="resource" value="./upload/pharmacies.txt" />
<property name="lineMapper">
<bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper">
<property name="lineTokenizer">
<bean class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer">
<property name="delimiter" value=","/>
<property name="names" value="nom,telephone,adresse,Latitude,Longitude" />
</bean>
</property>
<property name="fieldSetMapper">
<bean class="org.springframework.batch.item.file.mapping.BeanWrapperFieldSetMapper">
<property name="targetType" value="model.Pharmacie" />
</bean>
</property>
</bean>
</property>
</bean>
这是我运行的批处理程序。
public class BatchPharmacie {
public static void main (String [] args) throws Exception {
ClassPathXmlApplicationContext cpt = new ClassPathXmlApplicationContext("applicationContext.xml");
//cpt.start();
JobLauncher jobLauncher = (JobLauncher) cpt.getBean("jobLauncher");
Job job = (Job) cpt.getBean("importPharmacies");
//JobParameters parameter = new JobParametersBuilder().addDate("date", new Date())
// .addString("input.file", "C:/envdev/travail/in/personnes.txt").toJobParameters();
jobLauncher.run(job, new JobParameters());
}
}
java.lang.IllegalStateException: 输入资源必须存在(读取器处于“严格”模式):类路径资源