1

I am trying to use sftp using camel, and getting jsch esception. The route that I created for the SFTP -

<camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
    <package>myGroupId</package>
    <route>
      <from uri="file:src/srcData?noop=true"/>
      <choice>
        <when>
          <xpath>/person/city = 'London'</xpath>
          <to uri="file:src/targetData/UK"/>
        </when>
        <when>
          <xpath>/person/city = 'Chicago'</xpath>
          <to uri="file:src/targetData/US"/>
        </when>
        <when>
          <xpath>/person/city = 'Tokyo'</xpath>
          <to uri="sftp://XXXserverXXX:22/dir1/subdir?username=testUser?password=testPwd&amp;binary=true"/>
        </when>
        <otherwise>
          <to uri="file:src/targetData/OT"/>
        </otherwise>
      </choice>
    </route>
  </camelContext>

But with this configuration I am facing the following exception - com.jcraft.jsch.JSchException: reject HostKey:

4

1 回答 1

4

您可能应该定义一个主机文件:“knownHostsFile”选项应该指向一个 ssh 已知主机文件,其中包含您要连接的主机的公钥。

它实际上记录在这里:http ://camel.apache.org/ftp2.html

于 2012-12-17T14:20:34.997 回答