Spring集成-SFTP-JSCH-会话断开连接

Spring集成-SFTP-JSCH-会话断开连接,spring,spring-integration,Spring,Spring Integration,我正在尝试轮询远程目录中是否存在文件,并发送一条MQ消息,通知其他组件移动文件。在这种情况下,线程/轮询器通过密码登录并连接到服务器,几秒钟左右后立即与服务器断开连接,并出现异常“同步远程目录时出现问题…”,线程从中恢复,并重复出现相同的问题 下面是一个特定线程00000027的生命周期,它在几秒钟内连接和断开连接。凭据将通过Jsch API作为身份传入。它似乎试图使用其他选项进行身份验证,只通过密码成功,但立即断开连接 Spring集成xml(SFTP适配器-config) 最好的猜测是远程目

我正在尝试轮询远程目录中是否存在文件,并发送一条MQ消息,通知其他组件移动文件。在这种情况下,线程/轮询器通过密码登录并连接到服务器,几秒钟左右后立即与服务器断开连接,并出现异常“同步远程目录时出现问题…”,线程从中恢复,并重复出现相同的问题

下面是一个特定线程00000027的生命周期,它在几秒钟内连接和断开连接。凭据将通过Jsch API作为身份传入。它似乎试图使用其他选项进行身份验证,只通过密码成功,但立即断开连接

Spring集成xml(SFTP适配器-config)
最好的猜测是远程目录不存在。故障发生在列表操作期间

我有20多个目录要轮询,因此在启动时,SI SFTP适配器将尝试实例化至少20个与远程服务器的连接/会话。但是我的cacheSessionFactory设置为poolsize=10和sessionWaitTimeout=1000。显然这就是问题所在,池大小限制为10,而我有20个目录要池。SI/Spring sftp正尽最大努力在20名调查者之间共享这10个连接====设置poolsize=50和sessionTimeOut=10000。。很有魅力。

Gary,谢谢你的引导。这很有帮助。服务器上不存在列出的目录之一。现在,如何处理连接和断开连接。我怎样才能在相当长的一段时间内保持连接状态?可能是因为我要用密码进去吗?如果我使用公钥,它会改进吗?想法?使用
CachingSessionFactory
。我看到您已经配置了一个,但您没有在入站通道适配器中使用它。Gary,您是指sftp适配器上的缓存会话标志吗?如果没有,我已经用cachingsessionfactory poolsize=10和sessionWaitTimeout=1000No连接了sftpsessionfactory;这一点不再得到支持。虽然您已经配置了一个封装的bean
cachingSessionFactory
sftpSessionFactory
但您没有使用它;您的适配器引用的是会话工厂本身,而不是缓存:
session factory=“sftpSessionFactory”
应该是
session factory=“cachingssessionfactory”
。谢谢Gary,我错过了它。。但现在我明白了。。将远程目录同步到本地目录时出现问题;嵌套异常为org.springframework.messaging.MessaginException:无法获取池项目;嵌套异常为java.lang.IllegalStateException:未能创建SFTP会话,后跟原因:java.lang.IllegalStateException:连接失败,然后由:com.jcraft.jsch.jscheException:连接被外部主机关闭。我的Poolsize=10,SessionWTO=1000这不起作用,我的cacheSeesionFactory的默认Poolsize为2147483647,waitTimeout=9223372036854775807
<int:publish-subscribe-channel id="fileChannel">
    <int:interceptors>
        <int:wire-tap channel="logger"/>
    </int:interceptors>
</int:publish-subscribe-channel>

<int:logging-channel-adapter id="logger" level="INFO"/>

<!-- File polling and retrieval from source -->
<int-sftp:inbound-channel-adapter id="fileSource"
    channel="fileChannel" session-factory="sftpSessionFactory"
    charset="UTF-8" auto-create-local-directory="true"
    delete-remote-files="false" 
    remote-directory="${sourceRootDir}/${dir}" remote-file-separator="/"
    local-directory="${tempPath}" auto-startup="false" filter="fileFilter">
            <int:poller fixed-rate="5000" max-messages-per-poll="-1"/>  <!-- negative value means "get every file", DO NOT CHANGE without revisiting fileFilter logic -->
</int-sftp:inbound-channel-adapter>
<!-- Need an instance of the file filter per each context so it can carry 
    the property of the unique dir (which otherwise it has no way of discovering) -->
<bean id="fileFilter" class="com.pnc.tsc.hca.DownloadAvoidingFileFilter">
    <property name="filter" value=".tmp" />
    <property name="directory" value="${dir}" />
    <property name="channel" ref="queueChannel" />
    <property name="sourceRootDir" value="${sourceRootDir}" />
    <property name="destinationRootDir" value="${destinationRootDir}" />
</bean>

<bean id="sftpSessionFactory" 
    class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
        <property name="host" value="${SOURCE_FTP_HOST}"/>
        <property name="port" value="${SOURCE_FTP_PORT}"/>
        <property name="user" value="${SOURCE_FTP_USER}"/>
        <property name="password" value="${SOURCE_FTP_PASS}"/>
    </bean>

<bean id="cachingSessionFactory" 
    class="org.springframework.integration.file.remote.session.CachingSessionFactory">
    <constructor-arg ref="sftpSessionFactory"/>
        <property name="poolSize" value="${poolSize}"/>
        <property name="sessionWaitTimeout" value="${sessionWaitTimeout}"/>
</bean>
[6/30/15 13:54:37:073 EDT] 00000027 jsch          I    org.springframework.integration.sftp.session.JschLogger log Connecting to <<servername>> port 22
[6/30/15 13:54:37:112 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log Connection established
[6/30/15 13:54:37:146 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log Remote version string: SSH-2.0-OpenSSH_6.0
[6/30/15 13:54:37:274 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log Local version string: SSH-2.0-JSCH-0.1.53
[6/30/15 13:54:37:415 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
[6/30/15 13:54:37:435 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
[6/30/15 13:54:38:251 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
[6/30/15 13:54:38:889 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log SSH_MSG_KEXINIT sent
[6/30/15 13:54:38:932 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log SSH_MSG_KEXINIT received
[6/30/15 13:54:38:944 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: server: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
[6/30/15 13:54:39:023 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: server: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
[6/30/15 13:54:39:036 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: server: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
[6/30/15 13:54:39:099 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: server: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
[6/30/15 13:54:39:195 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: server: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
[6/30/15 13:54:39:270 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: server: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
[6/30/15 13:54:39:283 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: server: none,zlib@openssh.com
[6/30/15 13:54:39:297 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: server: none,zlib@openssh.com
[6/30/15 13:54:39:616 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: server:
[6/30/15 13:54:39:736 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: server:
[6/30/15 13:54:39:764 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: client: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
[6/30/15 13:54:39:789 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: client: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
[6/30/15 13:54:39:798 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
[6/30/15 13:54:39:808 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
[6/30/15 13:54:39:817 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
[6/30/15 13:54:39:833 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
[6/30/15 13:54:39:842 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: client: none
[6/30/15 13:54:39:853 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: client: none
[6/30/15 13:54:39:868 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: client:
[6/30/15 13:54:39:888 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: client:
[6/30/15 13:54:39:912 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: server->client aes128-ctr hmac-md5 none
[6/30/15 13:54:39:922 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: client->server aes128-ctr hmac-md5 none
[6/30/15 13:54:40:190 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log SSH_MSG_KEX_ECDH_INIT sent
[6/30/15 13:54:40:215 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log expecting SSH_MSG_KEX_ECDH_REPLY
[6/30/15 13:54:40:279 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log ssh_rsa_verify: signature true
[6/30/15 13:54:40:376 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log Host '<<servername>>' is known and matches the RSA host key
[6/30/15 13:54:40:398 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log SSH_MSG_NEWKEYS sent
[6/30/15 13:54:40:561 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log SSH_MSG_NEWKEYS received
[6/30/15 13:54:40:582 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log SSH_MSG_SERVICE_REQUEST sent
[6/30/15 13:54:40:595 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log SSH_MSG_SERVICE_ACCEPT received
[6/30/15 13:54:40:644 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log Authentications that can continue: publickey,keyboard-interactive,password
[6/30/15 13:54:40:660 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log Next authentication method: publickey
[6/30/15 13:54:40:776 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log Authentications that can continue: keyboard-interactive,password
[6/30/15 13:54:40:901 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log Next authentication method: keyboard-interactive
[6/30/15 13:54:41:339 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log Authentications that can continue: password
[6/30/15 13:54:41:349 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log Next authentication method: password
[6/30/15 13:54:41:381 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log Authentication succeeded (password).
[6/30/15 13:54:41:564 EDT] 00000027 SystemOut     O 13:54:41.564 INFO  [task-scheduler-2][com.pnc.tsc.hca.DownloadAvoidingFileFilter] File in directory inbound/cmnzip/ appear to be : [Lcom.jcraft.jsch.ChannelSftp$LsEntry;@5fda5fda
[6/30/15 13:54:41:565 EDT] 00000027 jsch          I org.springframework.integration.sftp.session.JschLogger log Disconnecting from <<servername>> port 22
[6/30/15 13:54:41:605 EDT] 00000027 LoggingHandle E org.springframework.integration.handler.LoggingHandler handleMessageInternal org.springframework.messaging.MessagingException: Problem occurred while synchronizing remote to local directory; nested exception is org.springframework.messaging.MessagingException: Failed to execute on session; nested exception is org.springframework.core.NestedIOException: Failed to list files; nested exception is 2: No such file
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:217)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.doReceive(AbstractInboundFileSynchronizingMessageSource.java:196)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.doReceive(AbstractInboundFileSynchronizingMessageSource.java:60)
at org.springframework.integration.endpoint.AbstractMessageSource.receive(AbstractMessageSource.java:64)
at org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:144)
at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:192)
at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:55)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:149)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:298)
at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:292)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:738)
Caused by: org.springframework.messaging.MessagingException: Failed to execute on session; nested exception is org.springframework.core.NestedIOException: Failed to list files; nested exception is 2: No such file
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:345)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:175)
... 23 more
Caused by: org.springframework.core.NestedIOException: Failed to list files; nested exception is 2: No such file
at org.springframework.integration.sftp.session.SftpSession.list(SftpSession.java:103)
at org.springframework.integration.sftp.session.SftpSession.list(SftpSession.java:50)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer$1.doInSession(AbstractInboundFileSynchronizer.java:179)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer$1.doInSession(AbstractInboundFileSynchronizer.java:175)
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:336)
... 24 more
Caused by: 2: No such file
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2846)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2198)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2215)
at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1565)
at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1526)
at org.springframework.integration.sftp.session.SftpSession.list(SftpSession.java:91)
... 28 more 
[7/7/15 13:17:52:751 EDT] 000000a0 jsch          I org.springframework.integration.sftp.session.JschLogger log kex: client->server aes128-ctr hmac-md5 none
[7/7/15 13:17:52:255 EDT] 000000a5 LoggingHandle E org.springframework.integration.handler.LoggingHandler handleMessageInternal org.springframework.messaging.MessagingException: Problem occurred while synchronizing remote to local directory; nested exception is org.springframework.messaging.MessagingException: Failed to obtain pooled item; nested exception is java.lang.IllegalStateException: failed to create SFTP Session
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:217)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.doReceive(AbstractInboundFileSynchronizingMessageSource.java:196)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.doReceive(AbstractInboundFileSynchronizingMessageSource.java:60)
at org.springframework.integration.endpoint.AbstractMessageSource.receive(AbstractMessageSource.java:64)
at org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:144)
at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:192)
at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:55)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:149)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:298)
at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:292)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:738)
Caused by: org.springframework.messaging.MessagingException: Failed to obtain pooled item; nested exception is java.lang.IllegalStateException: failed to create SFTP Session
at org.springframework.integration.util.SimplePool.getItem(SimplePool.java:178)
at org.springframework.integration.file.remote.session.CachingSessionFactory.getSession(CachingSessionFactory.java:118)
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:334)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:175)
... 23 more
Caused by: java.lang.IllegalStateException: failed to create SFTP Session
at org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:355)
at org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:49)
at org.springframework.integration.file.remote.session.CachingSessionFactory$1.createForPool(CachingSessionFactory.java:76)
at org.springframework.integration.file.remote.session.CachingSessionFactory$1.createForPool(CachingSessionFactory.java:73)
at org.springframework.integration.util.SimplePool.doGetItem(SimplePool.java:188)
at org.springframework.integration.util.SimplePool.getItem(SimplePool.java:169)
... 26 more
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:350)
... 31 more
Caused by: com.jcraft.jsch.JSchException: connection is closed by foreign host
at com.jcraft.jsch.Session.connect(Session.java:269)
at com.jcraft.jsch.Session.connect(Session.java:183)
at org.springframework.integration.sftp.session.SftpSession.connect(SftpSession.java:263)
... 32 more