我是 Spring 新手,我目前正在研究 stping 集成以将文件传输到 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 版本。请帮我解决这个问题。提前致谢