SFTP Spring 集成问题 2 *用户名* 的身份验证失败次数过多
SFTP Spring integration issue 2 Too many authentication failures for *username*
我们有一个 SFTP 服务器,我们在这个 server.I 上读取文件特定文件夹,我正在使用基于 user/password 的身份验证,我是否还需要在 DefaultSftpSessionFactory 中提供一些其他属性。
下面是我的配置。
<beans:bean id="sftpSessionFactory"
class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
<beans:property name="host" value="${turboFtp.host}" />
<beans:property name="allowUnknownKeys" value="true" />
<beans:property name="user" value="${turboFtp.username}" />
<beans:property name="password"
value="#{ftpdecrypter.decryptPassword()}" />
</beans:bean>
<beans:bean id="ftpdecrypter"
class="com.deere.calibrateddevices.config.FTPPasswordDecryptConfig">
</beans:bean>
<int-sftp:inbound-streaming-channel-adapter
id="sftpTurboHoneywellAdapter" channel="turboReceiveChannel"
session-factory="sftpSessionFactory" filename-regex="^.*\.(dat|DAT)$"
remote-file-separator="/" remote-directory-expression="'${turboXMLFileFtpServerLoc}'"
auto-startup="true">
<int:poller fixed-rate="${turboPollarInterval}"
max-messages-per-poll="1" />
</int-sftp:inbound-streaming-channel-adapter>
<int:channel id="sftpOutboundChannel" />
<int-sftp:outbound-gateway command="rm"
reply-channel="nullChannel" session-factory="sftpSessionFactory"
request-channel="sftpOutboundChannel" remote-file-separator="/"
expression="headers['file_remoteDirectory'] + headers['file_remoteFile']">
</int-sftp:outbound-gateway>
<integration:service-activator id="calibratedDataServiceActivator"
input-channel="turboReceiveChannel" ref="turboFtpFileProcessor"
method="processTurboCalibratedDeviceFile" />
它在一段时间内工作正常,但间歇性地出现以下错误。
org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:353)
at org.springframework.integration.util.ErrorHandlingTaskExecutor.run(ErrorHandlingTaskExecutor.java:55)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:51)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:344)
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(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: failed to create SFTP Session
at org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:393)
at org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:57)
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:433)
... 24 more
Caused by: java.lang.IllegalStateException: failed to connect
at org.springframework.integration.sftp.session.SftpSession.connect(SftpSession.java:273)
at org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:388)
... 26 more
Caused by: com.jcraft.jsch.JSchException: SSH_MSG_DISCONNECT: 2 Too many authentication failures for *username*
at com.jcraft.jsch.Session.read(Session.java:1004)
at com.jcraft.jsch.UserAuthPassword.start(UserAuthPassword.java:91)
at com.jcraft.jsch.Session.connect(Session.java:470)
at com.jcraft.jsch.Session.connect(Session.java:183
我不确定是什么导致了这个 issue.Is SFTP SpringIntegration 配置有任何问题吗?我是否还需要在 DefaultSftpSessionFactory class 中提供一些其他属性?还是 SFTP 服务器有问题?
谁能指导我解决这个问题。
失败的原因是用户 ID 在 server.After 释放块上被阻止,它工作正常。
我们有一个 SFTP 服务器,我们在这个 server.I 上读取文件特定文件夹,我正在使用基于 user/password 的身份验证,我是否还需要在 DefaultSftpSessionFactory 中提供一些其他属性。 下面是我的配置。
<beans:bean id="sftpSessionFactory"
class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
<beans:property name="host" value="${turboFtp.host}" />
<beans:property name="allowUnknownKeys" value="true" />
<beans:property name="user" value="${turboFtp.username}" />
<beans:property name="password"
value="#{ftpdecrypter.decryptPassword()}" />
</beans:bean>
<beans:bean id="ftpdecrypter"
class="com.deere.calibrateddevices.config.FTPPasswordDecryptConfig">
</beans:bean>
<int-sftp:inbound-streaming-channel-adapter
id="sftpTurboHoneywellAdapter" channel="turboReceiveChannel"
session-factory="sftpSessionFactory" filename-regex="^.*\.(dat|DAT)$"
remote-file-separator="/" remote-directory-expression="'${turboXMLFileFtpServerLoc}'"
auto-startup="true">
<int:poller fixed-rate="${turboPollarInterval}"
max-messages-per-poll="1" />
</int-sftp:inbound-streaming-channel-adapter>
<int:channel id="sftpOutboundChannel" />
<int-sftp:outbound-gateway command="rm"
reply-channel="nullChannel" session-factory="sftpSessionFactory"
request-channel="sftpOutboundChannel" remote-file-separator="/"
expression="headers['file_remoteDirectory'] + headers['file_remoteFile']">
</int-sftp:outbound-gateway>
<integration:service-activator id="calibratedDataServiceActivator"
input-channel="turboReceiveChannel" ref="turboFtpFileProcessor"
method="processTurboCalibratedDeviceFile" />
它在一段时间内工作正常,但间歇性地出现以下错误。
org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:353)
at org.springframework.integration.util.ErrorHandlingTaskExecutor.run(ErrorHandlingTaskExecutor.java:55)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:51)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:344)
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(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: failed to create SFTP Session
at org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:393)
at org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:57)
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:433)
... 24 more
Caused by: java.lang.IllegalStateException: failed to connect
at org.springframework.integration.sftp.session.SftpSession.connect(SftpSession.java:273)
at org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:388)
... 26 more
Caused by: com.jcraft.jsch.JSchException: SSH_MSG_DISCONNECT: 2 Too many authentication failures for *username*
at com.jcraft.jsch.Session.read(Session.java:1004)
at com.jcraft.jsch.UserAuthPassword.start(UserAuthPassword.java:91)
at com.jcraft.jsch.Session.connect(Session.java:470)
at com.jcraft.jsch.Session.connect(Session.java:183
我不确定是什么导致了这个 issue.Is SFTP SpringIntegration 配置有任何问题吗?我是否还需要在 DefaultSftpSessionFactory class 中提供一些其他属性?还是 SFTP 服务器有问题? 谁能指导我解决这个问题。
失败的原因是用户 ID 在 server.After 释放块上被阻止,它工作正常。