多个xsi:schemaLocation中出错

时间:2013-05-06 12:45:59

标签: spring sftp

我正在使用spring集成,我需要包含多个xsi:schemaLocation。

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:int="http://www.springframework.org/schema/integration"
       xmlns:int-sftp="http://www.springframework.org/schema/integration/sftp"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://www.springframework.org/schema/integration/sftp
                           http://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd">

我在部署无法加载时遇到错误:

Configuration problem: Failed to import bean definitions from relative location   
 [spring-beans.xml]
Offending resource: ServletContext resource [/WEB-INF/spring/appServlet/servlet-  
context.xml]; nested exception is  
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration
 problem: Unable to locate Spring NamespaceHandler for XML schema namespace 
 [http://www.springframework.org/schema/integration/sftp]
  Offending resource: ServletContext resource [/WEB-INF/spring/appServlet/spring-
 beans.xml]

1 个答案:

答案 0 :(得分:0)

spring-integration-sftp添加到我的pom.xml为我修复此问题。

<dependency>
    <groupId>org.springframework.integration</groupId>
    <artifactId>spring-integration-sftp</artifactId>
    <version>2.0.3.RELEASE</version>
</dependency>

2.0.3可能是一个旧版本,但这就是我们用于spring-integration-core的内容,所以我保持不变。