骆驼删除文件异常
Camel Delete File Exception
当我尝试在 Camel 中处理文件但失败时,我尝试将文件移动到错误目录但收到以下错误消息:
org.apache.camel.component.file.GenericFileOperationFailedException: 无法删除文件:....
我不知道 Windows 是否正在锁定文件,但我已经关闭了所有可能导致我这边发生这种情况的流。如果这是 Windows 我该怎么做才能释放这个锁?
路由很简单 from()... process().. to()
并且在 process()
之后设置了一些 headers 它是失败的 to()
并且文件不会移动到预期的错误目录。
谢谢。
可能与this有关:
Cannot move/delete file after processing on Windows
There is a potential issue on Windows platform with Camel 1.5.x. That
it cannot move or delete the file after processing. You should get an
exception thrown.
The workaround is to convert the body to a String after consuming
using convertBodyTo: eg
from("file://inbox").convertBodyTo(String.class).to("file://outbox");.
There should be a fix in Camel 1.6.0 to remedy this, but we would like
to get feedback on this issue. So if you are on Windows please give it
a go.
似乎有一个流氓流需要改变。我使用 Process Explorer 发现了这一点,因为它两次识别了同一个文件。一个锁被移除,另一个没有,我从中发现了一个未在 catch
块中处理的开放流。
当我尝试在 Camel 中处理文件但失败时,我尝试将文件移动到错误目录但收到以下错误消息:
org.apache.camel.component.file.GenericFileOperationFailedException: 无法删除文件:....
我不知道 Windows 是否正在锁定文件,但我已经关闭了所有可能导致我这边发生这种情况的流。如果这是 Windows 我该怎么做才能释放这个锁?
路由很简单 from()... process().. to()
并且在 process()
之后设置了一些 headers 它是失败的 to()
并且文件不会移动到预期的错误目录。
谢谢。
可能与this有关:
Cannot move/delete file after processing on Windows
There is a potential issue on Windows platform with Camel 1.5.x. That it cannot move or delete the file after processing. You should get an exception thrown.
The workaround is to convert the body to a String after consuming using convertBodyTo: eg from("file://inbox").convertBodyTo(String.class).to("file://outbox");.
There should be a fix in Camel 1.6.0 to remedy this, but we would like to get feedback on this issue. So if you are on Windows please give it a go.
似乎有一个流氓流需要改变。我使用 Process Explorer 发现了这一点,因为它两次识别了同一个文件。一个锁被移除,另一个没有,我从中发现了一个未在 catch
块中处理的开放流。