首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Apache Camel抛出SFTP连接的权限被拒绝

Apache Camel抛出SFTP连接的权限被拒绝
EN

Stack Overflow用户
提问于 2017-08-03 06:21:44
回答 1查看 1.9K关注 0票数 0

我必须从SFTP服务器读取一个文件。但在阅读时,骆驼抛出了com.jcraft.jsch.SftpException: Permission denied。但我对其中的文件夹和文件有读写权限。我试着用filezilla将文件移动到.done文件夹中,它可以工作。

路线:

代码语言:javascript
运行
复制
sftp://USERNAME@IP_ADDRESS:PORT/path?password=MY_PASSWORD&move=.done&binary=true&disconnect=true&include=FILENAME_(2\\d{3})(\\d{2})(\\d{2}).txt

Stacktrace

代码语言:javascript
运行
复制
o.a.c.c.file.remote.SftpConsumer         : Error processing file RemoteFile[FILENAME_20170802.txt] due to Cannot retrieve file: path/FILENAME_20170802.txt. Caused by: [org.apache.camel.component.file.GenericFileOperationFailedException - Cannot retrieve file: path/FILENAME_20170802.txt]

org.apache.camel.component.file.GenericFileOperationFailedException: Cannot retrieve file: path/FILENAME_20170802.txt
    at org.apache.camel.component.file.remote.SftpOperations.retrieveFileToStreamInBody(SftpOperations.java:704) ~[camel-ftp-2.19.1.jar:2.19.1]
    at org.apache.camel.component.file.remote.SftpOperations.retrieveFile(SftpOperations.java:648) ~[camel-ftp-2.19.1.jar:2.19.1]
    at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:408) [camel-core-2.19.1.jar:2.19.1]
    at org.apache.camel.component.file.remote.RemoteFileConsumer.processExchange(RemoteFileConsumer.java:137) [camel-ftp-2.19.1.jar:2.19.1]
    at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:218) [camel-core-2.19.1.jar:2.19.1]
    at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:182) [camel-core-2.19.1.jar:2.19.1]
    at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174) [camel-core-2.19.1.jar:2.19.1]
    at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101) [camel-core-2.19.1.jar:2.19.1]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_131]
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_131]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_131]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_131]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
Caused by: com.jcraft.jsch.SftpException: Permission denied
    at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2873) ~[jsch-0.1.54.jar:na]
    at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2225) ~[jsch-0.1.54.jar:na]
    at com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:1318) ~[jsch-0.1.54.jar:na]
    at com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:1290) ~[jsch-0.1.54.jar:na]
    at org.apache.camel.component.file.remote.SftpOperations.retrieveFileToStreamInBody(SftpOperations.java:689) ~[camel-ftp-2.19.1.jar:2.19.1]
    ... 14 common frames omitted
EN

Stack Overflow用户

发布于 2017-09-04 07:17:12

您提供的目录路径是相对的,而不是绝对的。只是确认一下是否是问题所在。

默认情况下,Camel将转到/home/{username}/目录。不是"\“根目录。

希望能帮上忙。

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45476343

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档