gpt4 book ai didi

apache-camel - 通用文件操作失败异常 : Cannot change directory to: . 。 - 尝试 SFTP 1G 文件时

转载 作者:行者123 更新时间:2023-12-02 15:34:22 25 4
gpt4 key购买 nike

我正在尝试通过 SFTP 获取大文件并试验 readLocks。当尝试获取 1G 文件(需要很多秒才能复制的大文件)时,出现以下异常。顺便说一句,当我尝试一个 1M 数量级的小文件时,SFTP 工作正常。

这是 Camel 2.12.1 中的错误还是我做错了什么?

2013-12-13 14:30:12,964 [alhost/outbound]  INFO SftpConsumer                   - Connected and logged in to: sftp://tdr@localhost:22
2013-12-13 14:30:19,893 [alhost/outbound] WARN SftpConsumer - Error processing file RemoteFile[Centos5.7-64-Base-GS-Image-UI.ova] due to Cannot change directory to: ... Caused by: [org.apache.camel.component.file.GenericFileOperationFailedException - Cannot change directory to: ..]
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot change directory to: ..
at org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:542)
at org.apache.camel.component.file.remote.SftpOperations.changeCurrentDirectory(SftpOperations.java:530)
at org.apache.camel.component.file.remote.SftpOperations.retrieveFileToStreamInBody(SftpOperations.java:656)
at org.apache.camel.component.file.remote.SftpOperations.retrieveFile(SftpOperations.java:594)
at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:362)
at org.apache.camel.component.file.remote.RemoteFileConsumer.processExchange(RemoteFileConsumer.java:99)
at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:201)
at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:165)
at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)
at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

我的路线如下所示:

from("sftp://tdr@localhost/outbound?password=xxx&delete=true&readLock=changed&delay=10000&readLockCheckInterval=3000")
.to("file:///home/cps/camel/input?flatten=true");

最佳答案

经过一番谷歌搜索后,我发现了添加 stepwise=false 以防止出现上述异常的建议。

设置stepwise=false 后,我遇到了OutOfMemory 异常 并添加了streamDownload=true
下面的路线现在将 sftp 我的大文件,我已经证明读锁有效,因为我验证了在我将大文件复制到 SFTP 目录时 SFTP 没有开始。

from("sftp://tdr@localhost/outbound?" +
"streamDownload=true" +
"&stepwise=false" +
"&password=xxx&delete=true&readLock=changed&delay=5000&readLockCheckInterval=2000")
.to("file:///home/cps/camel/input?" +
"flatten=true");

关于apache-camel - 通用文件操作失败异常 : Cannot change directory to: . 。 - 尝试 SFTP 1G 文件时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20576630/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com