【问题标题】:Spring Integration FTP - InboundChannelAdapter Stopped working with new FTP serverSpring Integration FTP - InboundChannelAdapter 停止使用新的 FTP 服务器
【发布时间】:2020-09-22 20:29:52
【问题描述】:

多年来,我一直在使用 Spring-Integration 4.1.6 连接到旧的 FTP 服务器。 FTP 服务器最近被更新的版本取代(新服务器是 Globalscape EFT Enterprise),我的 int-ftp 入站通道适配器立即停止查找文件。我监控了几个帐户,它们都同时停止工作。

这里是一个的配置:

<beans:bean id="ftpSessionFactory" class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory">
    <beans:property name="host" value="${ftp.host}" />
    <beans:property name="port" value="${ftp.port}" />
    <beans:property name="username" value="${ftp.username}" />
    <beans:property name="password" value="${ftp.password}" />
    <beans:property name="clientMode" value="2" />
    <beans:property name="fileType" value="2" />
    <beans:property name="bufferSize" value="5000000" />
</beans:bean>

<beans:bean id="cachingSessionFactory" class="org.springframework.integration.file.remote.session.CachingSessionFactory">
    <beans:constructor-arg ref="ftpSessionFactory" />
    <beans:constructor-arg value="1" />
    <beans:property name="sessionWaitTimeout" value="60000" />
</beans:bean>

<int-ftp:inbound-channel-adapter id="ftpInboundChannelAdapter" channel="ftpChannelIn" session-factory="cachingSessionFactory" auto-create-local-directory="true"
        delete-remote-files="true" remote-directory="dev" local-directory="C:/temp" auto-startup="true">
    <poller max-messages-per-poll="-1" receive-timeout="10000" cron="0 0/2 * * * *" >
        <transactional/>
    </poller>
</int-ftp:inbound-channel-adapter>

当我调试适配器时,我看到了这个语句:

[org.springframework.integration.ftp.inbound.FtpInboundFileSynchronizer] cannot copy, not a file: dev/dev

但dev下没有名为dev的文件夹,只有一个.csv文件。

结构为 /path/to/user/dev/file.csv,FTP 服务器配置为在用户执行 PWD 时向用户显示完整路径。

而且我确信当登录发生时,它们被放置在 /path/to/user 文件夹中。

我在本地环境中建立了另一个 FTP 服务器,它运行良好。

某些非标准 FTP 服务器是否存在问题导致此类问题?

提前谢谢你

【问题讨论】:

    标签: java ftp spring-integration-ftp


    【解决方案1】:

    事实证明,最新版本的 GlobalScape EFT (8.0.2.x) 错误地实现了 LIST 命令。当执行 LIST some/directory 进行监视时,它们返回的是目录本身的详细信息,而不是目录的内容。这是 7.x 版本的行为变化。

    如果我可以配置 Spring Integration FTP 库执行 CWD,然后列出当前文件夹,那就太好了。或者让它使用 NLST。但是,由于这只是 FTP 服务器上的一个错误,因此完全可以理解为什么不能这样做。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-24
      • 2018-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多