Iza*_* B. 4 java sftp apache-camel
我需要通过 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: /**
Run Code Online (Sandbox Code Playgroud)
我尝试使用camel SFTP选项maximumReconnectAttempts=10,serverAliveInterval=60并将camel版本更改为2.12.0,然后更改为2.10.7(问题已解决的版本),但这些都没有解决我的问题。似乎是一个错误,但奇怪的是,每次我尝试连接到我的服务器时,它都不会重现。
我很感激任何建议。
添加camel SFTP选项后我解决了我的问题disconnect=true。