'资源'属性值不令人耳目一新

时间:2013-03-12 10:52:52

标签: spring

// Jobs.xml

<bean id="deptartmentReader" class="org.springframework.batch.item.file.FlatFileItemReader">        
       <property name="resource" value="file:C:\TO-DEV\dept.data" />    
       <property name="lineMapper" ref="deptLineMapper" />      
    </bean>

// tasklet.java

ConfigurableApplicationContext context = new ClassPathXmlApplicationContext("Jobs.xml");

当我从unix脚本运行这个java文件时,我遇到错误

Caused by: java.lang.IllegalStateException: Input resource must exist (reader is in 'strict' mode): URL [file:C:\TO-DEV\OHM-Utils\dept.data]
        at org.springframework.batch.item.file.FlatFileItemReader.doOpen(FlatFileItemReader.java:250)
        at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.open(AbstractItemCountingItemStreamItemReader.java:134)
        ... 15 more

请就此提出建议......

0 个答案:

没有答案