Spring Integration-FTP出站通道适配器

时间:2013-10-28 13:57:08

标签: spring ftp integration outbound

我是Spring的新手,我目前正致力于将文件转移到FTP位置。请在下面找到我的Spring-context.xml,

    <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-ftp="http://www.springframework.org/schema/integration/ftp"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
                    http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                    http://www.springframework.org/schema/context
                    http://www.springframework.org/schema/context/spring-context-3.1.xsd
                    http://www.springframework.org/schema/integration
                    http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
                    http://www.springframework.org/schema/integration/ftp
                    http://www.springframework.org/schema/integration/ftp/spring-integration-ftp-2.0.xsd">

    <context:property-placeholder location="classpath:Test.properties"/>

    <bean id="ftpClientFactory" class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory">
        <property name="host" value="${host}"/>
        <property name="port" value="${availableServerPort}"/>
        <property name="username" value="${userid}"/>
        <property name="password" value="${password}"/>
    </bean>

    <int:channel id="ftpChannel"/>

    <int-ftp:outbound-channel-adapter  id="ftpOutbound" cache-sessions="false" charset="UTF-8" channel="ftpChannel" remote-directory="/" session-factory="ftpClientFactory"/>
</beans>

加载此XML文件时。我收到以下错误信息

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: 
Line 27 in XML document from class path resource [FTPOutboundChannelAdapterSample-context.xml]
is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 27; columnNumber:
171; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found 
for element 'int-ftp:outbound-channel-adapter'.

我在上面添加了xmlns:int-ftp声明,但仍然收到错误消息。我使用的是spring-integration-core-2.2.1,spring-integration-test-2.2.1,所有其他与spring相关的jar都是3.1.4版本。请帮我解决这个问题。提前致谢

0 个答案:

没有答案