0
votes

Please see the beginning of the spring-integration-config file below. If I have the reference to spring-integration-sftp (not version 3.02.) in the schema location I am receiving the following error:

Referenced file contains errors (http://www.springframework.org/schema/integration/spring-integration-2.0.xsd).

However, if I switch to the 3.0.2 version of spring-integration-sftp I am getting the following error:

The matching wildcard is strict, but no declaration can be found for element 'int-sftp:outbound-channel-adapter'.

The spring-integration-config.xml code related to spring-integration-sftp is as follows:

<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" />

The beginning of the spring-integration-config file is as follows:

<?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">
1
Why don't you use the same version of Spring Integration for all your schemas? For example, 3.0. Now, you have a mix in there: some are 3.0 others depend on what you have in classpath. - Andrei Stefan
The first error was gone when I switched to the ftp version 3.0.2. Then I got this error with sftp integration - Alex
Right, but you have spring-integration-file.xsd in there, as well. And spring-integration-amqp.xsd. Switcf to spring-integration-file-3.0.xsd and spring-integration-amqp-3.0.xsd and see how it goes. - Andrei Stefan
Thanks, this change to 3.0 does not help for the sftp problem - Alex

1 Answers

0
votes

Our recommendation do not use versions for XSD at all. The framework read the latest one from classpath. it allow you to avoid changes after upgrade.

From other side, if you mention 3.0.2 be sure you use correct jars of Spring Integration. And all of them should be the same version.

If you have some doubts with allowed attributes, take a look into correct XSD, if they are present. You can find them in the appropriate jar, e.g. org/springframework/integration/sftp/config/spring-integration-sftp-3.0.xsd.