2012-12-17 153 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