2014-08-27 98 views
3

我需要通過SFTP連接到服務器,我收到此錯誤:駱駝SFTP - 無法更改目錄「/」

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: /** 

我試圖用駱駝SFTP選項maximumReconnectAttempts=10serverAliveInterval=60和改變駱駝版本到2.12.0,然後到2.10.7(問題已解決的版本),但這些問題都沒有解決我的問題。 似乎是一個錯誤,但奇怪的是,它不是每次都重現我嘗試連接到我的服務器。

我很欣賞任何形式的建議。

回答

1

您有雙斜線,例如//home/tomcat/directory,表示絕對路徑。

也許與嘗試,所以其相對路徑sftp://myserver.com:22/home/tomcat/directory

+0

那麼,我需要使用絕對路徑,因爲我想連接到不同的機器。如果我使用相對路徑,我無法連接到我需要的目錄。 – 2014-08-27 14:12:18

+0

請確保您有權這樣做 – 2014-08-27 15:07:42

+0

我擁有我需要的所有權限。有時我能夠與成功聯繫在一起,並且不會拋出異常,但有時我不會。也許我會用駱駝SCP .. – 2014-08-28 06:33:01

3

我解決我的問題,增加了駱駝SFTP選項disconnect=true後單斜線。

+0

也爲我工作。我還必須把'stepwise = false'選項。失敗僅在第二次連接上產生錯誤,第一次連接總是成功。使用'disconnect = true'強制釋放兩次連續調用之間的連接。 – 2016-09-01 07:31:52

0

對我來說,駱駝版本2.17.1修復了這個問題。我以前的版本有這個問題是2.15.3和2.15.4。