Camel SFTP - Cannot change directory to '/'

一曲冷凌霜 提交于 2019-12-07 09:40:04

问题


I need to connect via SFTP to a server and I receive this error:

INFO  [org.apache.camel.component.file.remote.SftpOperations.connect]: **Connected to sftp://myserver.com:22**
INFO  [org.apache.camel.component.file.remote.RemoteFileProducer.connectIfNecessary]: **Connected and logged in to: Endpoint[sftp://myserver.com:22//home/tomcat/directory?password=******]
INFO  [org.apache.camel.component.file.remote.SftpOperations$JSchLogger.log]: JSCH -> **Caught an exception, leaving main loop due to Read timed out**
INFO  [org.apache.camel.component.file.remote.SftpOperations$JSchLogger.log]: JSCH -> **Disconnecting from myserver.com port 22**
WARN  [org.apache.camel.component.file.remote.RemoteFileProducer.handleFailedWrite]: **Writing file failed with: Cannot change directory to: /**

I tried to use camel SFTP options maximumReconnectAttempts=10, serverAliveInterval=60 and to change the camel version to 2.12.0 and then to 2.10.7 (versions where the issue is fixed), but none of these fixed my issue. Seems to be a bug , but the weird thing is that it is not reproduced every time I try to connect to my server.

I appreciate any kind of suggestions.


回答1:


I solved my issue after adding the camel SFTP option disconnect=true.




回答2:


You have double slash, eg //home/tomcat/directory which indicates an absolute path.

Maybe try with, a single slash so its a relative path sftp://myserver.com:22/home/tomcat/directory




回答3:


For me, camel version 2.17.1 fixed the issue. My previous versions that had the problem was 2.15.3 and 2.15.4.



来源:https://stackoverflow.com/questions/25524582/camel-sftp-cannot-change-directory-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!