2016-04-01 25 views
1

Dosyayı Spring Integration sftp giden kanal bağdaştırıcısı kullanarak sftp'ye göndermeye çalışıyorum.sftp: giden-kanal-bağdaştırıcısı reddetme HostKey

<int-sftp:outbound-channel-adapter id="sftpOutboundAdapter" session-factory="sftpSessionFactory"channel="sftpChannel" charset="UTF-8" remote-directory="/sftp/home/sftp_foler" remote-filename-generator-expression="'dummy.txt'"/> 

aşağıda hatası alıyorum ..

Caused by: java.lang.IllegalStateException: failed to connect 
    at org.springframework.integration.sftp.session.SftpSession.connect(SftpSession.java:272) 
    at org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:377) 
    ... 42 more 
Caused by: com.jcraft.jsch.JSchException: reject HostKey: myHost 
    at com.jcraft.jsch.Session.checkHost(Session.java:791) 
    at com.jcraft.jsch.Session.connect(Session.java:342) 
    at com.jcraft.jsch.Session.connect(Session.java:183) 
    at org.springframework.integration.sftp.session.SftpSession.connect(SftpSession.java:263) 

sanırım, hiç karşı StrictHostKeyChecking ayarlamak gerekebilir, ama nasıl sftp giden ağ geçidi değerini ayarlamak için? Lütfen değerli önerinizi belirtin. Belki bu bir

cevap

0

: Önceden

, bilinmeyen ana bilgisayarlara DefaultSftpSessionFactory koşulsuz izin bağlantıları. Bu şimdi yapılandırılabilir (varsayılan yanlış). allowUnknownKeys mülkiyet true (varsayılan false) olmadıkça

fabrika artık yapılandırılmış knownHosts dosyası gerektirir. Cevabınız için

http://docs.spring.io/spring-integration/reference/html/whats-new.html#_default_sftp_session_factory

+0

Teşekkür Bilan. allowUnknownKeys defaultSftpSessionFacory içinde true olarak ekledikten sonra, bir çekicilik gibi çalışır! –

İlgili konular