2012-12-17 155 views
1

我想使用sftp使用骆驼,并获得jsch的感知。 我的SFTP创建的路线 -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> 

但有了这个配置我对着下面的异常 - com.jcraft.jsch.JSchException:拒绝HostKey:

回答

3

你或许应该定义一个主机文件: “knownHostsFile”选项应该指向一个ssh已知主机文件,并在其中连接到的主机的公钥。

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