我正在运行一个基本的弹簧批处理应用程序(使用spring 2.0.2.RELEASE),我收到此错误:
org.springframework.batch.item.file.FlatFileParseException:在lin解析错误 e:资源中的1 = [类路径资源[employee.csv]],输入= [ë-------< - + /_Á---- -------------------------]
我发现this question有同样的错误,但那里提到的解决方案对我不起作用。
我的glm::vec4 wlh = inverseMVP * glm::vec4(ndc_left, 1.0f);
glm::vec4 wrh = inverseMVP * glm::vec4(ndc_right, 1.0f);
glm::vec3 worldPositionLeft = glm::vec3( wlh.x, wlh.y, wlh.z ) / wlh.w;
glm::vec3 worldPositionRight = glm::vec3( wrh.x, wrh.y, wrh.z ) / wrh.w;
方法是:
FlatFileItemReader
employee.csv文件是:
@Bean
public FlatFileItemReader<Employee> reader() {
FlatFileItemReader<Employee> reader = new FlatFileItemReader<Employee>();
reader.setResource(new ClassPathResource("employee.csv"));
reader.setLineMapper(new DefaultLineMapper<Employee>(){{
setLineTokenizer(new DelimitedLineTokenizer(){{
setNames(new String[]{"cpfAccNo", "empName", "ordinaryWages", "additionalWages", "cpfContrib", "cdac", "mbmf", "sinda", "ecf", "age"});
}});
setFieldSetMapper(new BeanWrapperFieldSetMapper<Employee>(){{
setTargetType(Employee.class);
}});
}});
return reader;
}
这是我的Employee.java类文件:
S6487598L, Name3, 21709, 0, 4342, 0, 0, 0, 10, 42
S8887897P, Name4, 4555, 0, 456, 0, 10, 0, 0, 48
需要注意的是,完全相同的代码片段和csv文件在不同的机器上使用spring 1.5.13工作正常。