Hey all,
I was trying out the spring integration project while testing with large files that may come in, and it seems the output-channel for a file-source/target invokes the copy() on the file before it finishes copying. (I'm just returning the message immediately.) Essentially, I can't use the file yet, it's only coincidence that I'm passing it off to another stream; I can't open a stream against the file since it's not done. Is there any way to remedy this and have it re-fire the message?
Code:org.springframework.integration.message.MessageHandlingException: failure occurred mapping file to message at org.springframework.integration.adapter.file.SimpleFileMessageMapper.mapMessage(SimpleFileMessageMapper.java:63) at org.springframework.integration.adapter.file.SimpleFileMessageMapper.mapMessage(SimpleFileMessageMapper.java:1) at org.springframework.integration.adapter.file.FileTarget.send(FileTarget.java:43) at org.springframework.integration.endpoint.TargetEndpoint.send(TargetEndpoint.java:183) at org.springframework.integration.dispatcher.SimpleDispatcher.dispatch(SimpleDispatcher.java:99) at org.springframework.integration.dispatcher.DefaultPollingDispatcher.dispatch(DefaultPollingDispatcher.java:65) at org.springframework.integration.dispatcher.PollingDispatcherTask.run(PollingDispatcherTask.java:56) at org.springframework.integration.scheduling.SimpleMessagingTaskScheduler$MessagingTaskRunner.run(SimpleMessagingTaskScheduler.java:138) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Caused by: java.io.FileNotFoundException: C:\TEMP\test_in\bigfile.txt (The process cannot access the file because it is being used by another process) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at org.springframework.util.FileCopyUtils.copy(FileCopyUtils.java:63) at org.springframework.integration.adapter.file.SimpleFileMessageMapper.writeToFile(SimpleFileMessageMapper.java:75) at org.springframework.integration.adapter.file.SimpleFileMessageMapper.mapMessage(SimpleFileMessageMapper.java:59) ... 16 more


Reply With Quote
