首页 > 解决方案 > Camel SFTP无法建立连接

问题描述

我在 localhost:2222 的一个 docker 容器中安装了 SFTP 服务器,用户 user/pass 尝试通过 camel 2.22.0 路由在另一个容器中建立连接,例如

  from("sftp:user@localhost:2222/sftp/in?password=pass"))
   .log("${file:name}");

但是因为无法连接

  Error auto creating directory:/sftp/in due Cannot connect to sftp://user@localhost:2222. This exception is ignored.

org.apache.camel.component.file.GenericFileOperationFailedException: Cannot connect to sftp://pms@localhost:2222
at org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:144)
at org.apache.camel.component.file.remote.RemoteFileConsumer.connectIfNecessary(RemoteFileConsumer.java:233)

Caused by: com.jcraft.jsch.JSchException: java.net.ConnectException: Connection refused (Connection refused)
at com.jcraft.jsch.Util.createSocket(Util.java:394)

从骆驼 2.18.2 移动到骆驼 2.22.0 后得到了这个。有可能修复吗?

标签: apache-camel

解决方案


我们在开发过程中从骆驼 2.20.0 升级到骆驼 2.22.0。升级后,我们无法从另一台服务器访问骆驼。同样的问题,连接被拒绝。我们降级到 2.20.0,一切又开始运转了


推荐阅读