无法使用Jcraft JSch和骆驼连接到sftp

时间:2020-10-12 13:48:31

标签: java apache-camel sftp talend jsch

我正在尝试通过骆驼路线连接到SFTP sftp服务器。但是我遇到了一些与jCraft Jsch异常有关的错误:

原因:com.jcraft.jsch.JSchException:验证失败 在com.jcraft.jsch.Session.connect(Session.java:512) 在org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:124)

这是我的代码,可在xml设置中读取。

.recipientList(simple("sftp://${exchangeProperty.x_username}@${exchangeProperty.x_host}:${exchangeProperty.x_port}/${exchangeProperty.folder}"
+ "?privateKeyFile=${exchangeProperty.privatekey}"
+ "&privateKeyPassphrase=${exchangeProperty.keypassphrase}"
+ "&password=${exchangeProperty.password}"
+ "&preferredAuthentications=publickey"
+ "&passiveMode=${exchangeProperty.mode}"
+ "&connectTimeout=${exchangeProperty.timeout_connect}"
+ "&soTimeout=${exchangeProperty.timeout_socket}"
+ "&timeout=${exchangeProperty.timeout_read}"
+ "&tempFileName=inprogress.${file:name}.filepart"
+ "&stepwise=${exchangeProperty.stepwise}"
+ "&fastExistsCheck=${exchangeProperty.fastExistsCheck}"
+ "&disconnect=true"
)).cacheSize(-1)

0 个答案:

没有答案