"弹簧一体化-2.0.XSD"为int-jdbc指定支持的XSD时出错

时间:2014-06-11 17:44:35

标签: java spring xsd spring-integration spring-jdbc

我有一个功能性的Spring Integration上下文配置文件。我想添加jdbc功能。当我导入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:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:int="http://www.springframework.org/schema/integration"
    xmlns:int-file="http://www.springframework.org/schema/integration/file"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                    http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
                    http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
                    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

此配置将导致异常(即使我引用了examples Github project

中的内容
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:int="http://www.springframework.org/schema/integration"
    xmlns:int-file="http://www.springframework.org/schema/integration/file"
    xmlns:int-jdbc="http://www.springframework.org/schema/integration/jdbc"
    xmlns:jdbc="http://www.springframework.org/schema/jdbc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                    http://www.springframework.org/schema/integration/jdbc http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd
                    http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
                    http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
                    http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
                    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

例外是:(http://i.imgur.com/rYo1iC4.pngenter image description here

以下是我正在使用的版本:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <org.springframework-version>3.1.0.RELEASE</org.springframework-version>
    <spring.integration.version>2.2.4.RELEASE</spring.integration.version>
    <log4j.version>1.2.17</log4j.version>
    <junit.version>4.11</junit.version>
    <org.slf4j-version>1.6.6</org.slf4j-version>
</properties>

编辑:只添加jdbc(而不是int-jdbc)也没关系。添加两者时都会出现问题。

edit2:在我尝试使用<int-jdbc:outbound-channel-adapter>...

之前,我没有收到错误

2 个答案:

答案 0 :(得分:1)

首先,它只是来自IDE的验证错误。 您可以使用Spring支持它(例如IDEA或STS)来解决它。

从另一方面,使用如此古老的Spring和Spring Integration版本的原因是什么?

http://projects.spring.io/spring-integration

答案 1 :(得分:0)

我的监督。这不是在pom。

<dependency>
    <groupId>org.springframework.integration</groupId>
    <artifactId>spring-integration-jdbc</artifactId>
    <version>${spring.integration.version}</version>
</dependency>