從過去的幾天來看,我收到了這個錯誤,無法前進。
請找到錯誤日誌和內容,並幫助我找出問題。
我的文件被物理地離開在下面提及的位置(X:/Content/E/data/FIXED.dat)。Reissing彈簧錯誤:資源必須存在:[class path resource [X:/Content/E/data/FIXED.dat]
DWHConfig.xml:
<bean id="reader" class="org.springframework.batch.item.file.FlatFileItemReader">
<property name="resource" value="X:/Content/E/data/FIXED.dat"/>
<property name="firstLineIsHeader" value="false"/>
<property name="recordSeparatorPolicy">
<bean class="org.springframework.batch.item.file.separator.SimpleRecordSeparatorPolicy" /> </property>
<property name="lineTokenizer">
<bean class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer">
<property name="delimiter" value="|"/>
</bean>
</property>
<property name="fieldSetMapper">
<bean class="com.telenor.metro2.conn.ess.batch.DWH.maping.DWHInput_Mapper" />
</property>
</bean>
錯誤:
Jan 9, 2013 2:16:44 PM org.springframework.batch.core.step.AbstractStep execute
SEVERE: Encountered an error executing the step: class org.springframework.batch.core.UnexpectedJobExecutionException: Failed to initialize the step
Jan 9, 2013 2:16:45 PM org.springframework.batch.core.launch.support.SimpleJobLauncher$1 run
INFO: Job: [SimpleJob: [name=DWHDailyJob]] failed with the following parameters: [{jobName=DWH-Fixed_daily_dap-ess-ora01}{}{}{schedule.date=Wed Jan 09 00:00:00 GMT+05:30 2013}]
Throwable occurred: org.springframework.batch.core.UnexpectedJobExecutionException: Failed to initialize the step
at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:170)
at org.springframework.batch.core.job.SimpleJob.execute(SimpleJob.java:100)
at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:86)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:81)
at com.telenor.metro2.conn.ess.batch.launcher.DWHFJobDetail.start(DWHFJobDetail.java:103)
at com.telenor.metro2.conn.ess.batch.launcher.DWHFJobDetail.execute(DWHFJobDetail.java:47)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: org.springframework.batch.item.ItemStreamException: Failed to initialize the reader
at org.springframework.batch.item.support.AbstractBufferedItemReaderItemStream.open(AbstractBufferedItemReaderItemStream.java:157)
at org.springframework.batch.item.support.CompositeItemStream.open(CompositeItemStream.java:103)
at org.springframework.batch.core.step.item.ItemOrientedStep.open(ItemOrientedStep.java:439)
at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:167)
... 8 more
**Caused by: java.lang.IllegalStateException: Resource must exist: [class path resource [X:/Content/E/data/FIXED.dat**]]
at org.springframework.util.Assert.state(Assert.java:384)
at org.springframework.batch.item.file.FlatFileItemReader.doOpen(FlatFileItemReader.java:226)
at org.springframework.batch.item.support.AbstractBufferedItemReaderItemStream.open(AbstractBufferedItemReaderItemStream.java:154)
... 11 more
您是否有URL試圖代替的路徑? (file:/ X:....) – YMomb
你可以舉一些例子。我沒有得到URL模式。感謝您的快速回復 –