簡體   English   中英

spring-config文件中舊版本的spring-integration-sftp給出XML錯誤,而3.0.2版給出outbound-channel-adapter的錯誤。

[英]Old versions of spring-integration-sftp in the spring-config file give the XML error but version 3.0.2 gives the error for outbound-channel-adapter

請參閱下面的spring-integration-config文件的開頭。 如果在架構位置中引用了spring-integration-sftp(不是3.02版),則會收到以下錯誤:

引用的文件包含錯誤( http://www.springframework.org/schema/integration/spring-integration-2.0.xsd )。

但是,如果切換到spring-integration-sftp的3.0.2版本,則會出現以下錯誤:

匹配的通配符很嚴格,但是找不到元素'int-sftp:outbound-channel-adapter'的聲明。

與spring-integration-sftp相關的spring-integration-config.xml代碼如下:

<bean id="sftpSessionFactory"
    class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
    <property name="host" value="${seaWorldOrlando.sftp.host}" />
    <property name="port" value="${seaWorldOrlando.sftp.port}" />
    <property name="user" value="${seaWorldOrlando.sftp.user}" />
    <property name="password" value="${seaWorldOrlando.sftp.password}" />
</bean>

<int-sftp:outbound-channel-adapter
    id="sftpOutboundAdapter" channel="toFtp" charset="UTF-8"
    remote-directory="/home/request" session-factory="sftpSessionFactory" />

spring-integration-config文件的開頭如下:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-amqp="http://www.springframework.org/schema/integration/amqp"
xmlns:rabbit="http://www.springframework.org/schema/rabbit"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:int-ftp="http://www.springframework.org/schema/integration/ftp"
xmlns:int-file="http://www.springframework.org/schema/integration/file"
xmlns:int-sftp="http://www.springframework.org/schema/integration/sftp"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:batch="http://www.springframework.org/schema/batch" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/integration/amqp http://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd
                    http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-3.0.xsd
                    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd 
                    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
                    http://www.springframework.org/schema/integration/ftp http://www.springframework.org/schema/integration/ftp/spring-integration-ftp-3.0.xsd
                    http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
                    http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-3.0.xsd
                    http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
                    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
                    http://www.springframework.org/schema/integration/sftp http://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd                 
                    http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit-1.1.xsd">

我們的建議完全不使用XSD版本。 該框架從classpath中讀取了最新的框架。 它使您避免升級后進行更改。

另一方面,如果您提到3.0.2,請確保使用正確的Spring Integration jar。 它們都應該是相同的版本。

如果對允許的屬性有疑問,請查看正確的XSD(如果存在)。 您可以在適當的jar中找到它們,例如org/springframework/integration/sftp/config/spring-integration-sftp-3.0.xsd

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM