Java 无法设置输出文件:Spring批处理作业
我在运行spring批处理作业时遇到问题。我对批处理作业配置很有信心,因为相同的was设置在过去四天中运行良好。我正在附加运行作业时生成的堆栈跟踪片段 片段1:Java 无法设置输出文件:Spring批处理作业,java,spring-batch,Java,Spring Batch,我在运行spring批处理作业时遇到问题。我对批处理作业配置很有信心,因为相同的was设置在过去四天中运行良好。我正在附加运行作业时生成的堆栈跟踪片段 片段1: 2014-08-20 00:00:01,895 ERROR [STDERR] org.springframework.batch.item.ItemStreamException: Unable to create file: [F:\jboss-4.2.3\config\feeds\jsdnmp\dailybillingfeeds\D
2014-08-20 00:00:01,895 ERROR [STDERR] org.springframework.batch.item.ItemStreamException: Unable to create file: [F:\jboss-4.2.3\config\feeds\jsdnmp\dailybillingfeeds\DailyBillFeed_jsdnmp_19-8-2014.csv]
2014-08-20 00:00:01,896 ERROR [STDERR] at org.springframework.batch.item.util.FileUtils.setUpOutputFile(FileUtils.java:80)
2014-08-20 00:00:01,896 ERROR [STDERR] at org.springframework.batch.item.file.FlatFileItemWriter$OutputState.initializeBufferedWriter(FlatFileItemWriter.java:497)
2014-08-20 00:00:01,896 ERROR [STDERR] at org.springframework.batch.item.file.FlatFileItemWriter$OutputState.access$000(FlatFileItemWriter.java:354)
2014-08-20 00:00:01,896 ERROR [STDERR] at org.springframework.batch.item.file.FlatFileItemWriter.doOpen(FlatFileItemWriter.java:291)
2014-08-20 00:00:01,896 ERROR [STDERR] at org.springframework.batch.item.file.FlatFileItemWriter.open(FlatFileItemWriter.java:281)
2014-08-20 00:00:01,896 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor274.invoke(Unknown Source)
2014-08-20 00:00:01,897 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Snippet 2: Caused by:
2014-08-20 00:00:01,900 ERROR [STDERR] Caused by: java.io.IOException: Could not delete file: F:\jboss-4.2.3\config\feeds\jsdnmp\dailybillingfeeds\DailyBillFeed_jsdnmp_19-8-2014.csv
2014-08-20 00:00:01,900 ERROR [STDERR] at org.springframework.batch.item.util.FileUtils.setUpOutputFile(FileUtils.java:65)
2014-08-20 00:00:01,900 ERROR [STDERR] ... 27 more
我已提供文件的所有修改权限。这是输出文件位置:
F:\jboss-4.2.3\config\feeds\jsdnmp\dailybillingfeeds\DailyBillFeed_jsdnmp_19-8-2014.csv
我尝试了使用appendAllowed和shouldDeleteIfExists的选项,但没有找到任何预期的输出
根据我提供的以下信息可能对您有所帮助:
- 窗口7
- 日食太阳神
- Jboss 4.2 GA
- jdk6
- 将下面的plugin标记添加到pom.xml中,以便每个maven安装命令都将所有maven依赖项复制到project/lib文件夹中
<plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <phase>install</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>H:/workspace/JsonProject/lib</outputDirectory> </configuration> </execution> </executions> </plugin>
maven依赖插件 安装 复制依赖项 H:/workspace/JsonProject/lib
- 然后在项目生成路径中包含lib文件夹中存在的所有jar
- 请执行以下操作:
当你有AppendOn时,它真的会追加吗?你或其他人有没有可能控制这个文件?(又名已打开,因此无法删除?)(仅建议您之前说的此b/c正在工作)不,它没有附加。最后我得到了例外。无法覆盖。这两个关键词,我都添加了,只是为了检查后它的工作力。