Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
入站通道在Spring中不工作_Spring_Spring Aop_Spring Integration - Fatal编程技术网

入站通道在Spring中不工作

入站通道在Spring中不工作,spring,spring-aop,spring-integration,Spring,Spring Aop,Spring Integration,我正在尝试从FTP复制文件,并希望将其放置在本地计算机中 为此,我创建了一个入站通道配置: <bean name="publishStockSessionFactory" class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory"> <property name="host" value="10.255.255.1" /> <property

我正在尝试从FTP复制文件,并希望将其放置在本地计算机中

为此,我创建了一个入站通道配置:

<bean name="publishStockSessionFactory"
      class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory">
  <property name="host"
        value="10.255.255.1" />
<property name="port" value="21" />
    <property name="username"
        value="test" />
    <property name="password"
        value="test" />
</bean>

<bean id="stockLocalDirectory" class="java.lang.String">
    <constructor-arg
        value="/opt/test" />
</bean>

<bean id="stockRemoteDirectory" class="java.lang.String">
    <constructor-arg
        value="stock" />
</bean>

<int-ftp:inbound-channel-adapter 
     local-directory="# {stockLocalDirectory}"             
     channel="stockFilesFromFTP"  
     session-factory="publishStockSessionFactory" 
     remote-directory="#{stockRemoteDirectory}" 
     delete-remote-files="true" 
     filename-regex="Stock*.csv" >
    <int:poller fixed-rate="120000" max-messages-per-poll="100" />
</int-ftp:inbound-channel-adapter>

<int:publish-subscribe-channel id="stockFilesFromFTP" />
我们打开的调试是

log4j.logger.org.springframework.aop=DEBUG
org.springframework.integration.channel.DirectChannel=DEBUG
org.springframework.integration.channel.MessagePublishingErrorHandler=DEBUG
org.springframework.integration.config.xml.PointToPointChannelParser=DEBUG

您能建议我如何调试此错误吗?

使用调试级别日志运行


您必须在通道上至少有一个订阅服务器
stockFilesFromFTP

我对FTPClientFactorybean使用了以下配置。它也有timeout参数,所以如果您由于连接超时而面临问题,这将对您有所帮助

<bean id="testapp.standardFTPClientFactory" class="org.springframework.integration.ftp.DefaultFTPClientFactory"
        abstract="true">
        <property name="host" value="${ftp.host}"/>
        <property name="username" value="${ftp.username}"/>
        <property name="password" value="${ftp.password}"/>
        <property name="port" value="${ftp.port}"/>
        <property name="remoteWorkingDirectory" value="${ftp.remotedir}"/>
        <property name="dataTimeout" value="3600000"/>
        <property name="connectTimeout" value="${ftp.connectTimeout}"/>
        <property name="clientMode" value="2"/>
</bean>


谢谢Russell,上面的调试已打开,但日志中没有任何信息。我们在上述配置中添加了通道的订阅服务器。是正确的吗?Rusell.我打开了org.springframework.integration,日志中没有与集成相关的信息。如果输入,我如何找出根本原因。
<bean id="testapp.standardFTPClientFactory" class="org.springframework.integration.ftp.DefaultFTPClientFactory"
        abstract="true">
        <property name="host" value="${ftp.host}"/>
        <property name="username" value="${ftp.username}"/>
        <property name="password" value="${ftp.password}"/>
        <property name="port" value="${ftp.port}"/>
        <property name="remoteWorkingDirectory" value="${ftp.remotedir}"/>
        <property name="dataTimeout" value="3600000"/>
        <property name="connectTimeout" value="${ftp.connectTimeout}"/>
        <property name="clientMode" value="2"/>
</bean>