2014-07-07 63 views
0

我想知道更好citrus framework集成测试。 我尝试创建FTP发送者,但我有以下错误:柑橘框架ftp连接

Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/integration/file] 

违犯的资源:类路径资源[柑橘的context.xml]

这里是我的柑橘context.xml文件的一部分:

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:citrus="http://www.citrusframework.org/schema/config" 
    xmlns:si="http://www.springframework.org/schema/integration" 
    xmlns:file="http://www.springframework.org/schema/integration/file" 
    xmlns:citrus-ws="http://www.citrusframework.org/schema/ws/config" 
    xmlns:citrus-http="http://www.citrusframework.org/schema/http/config" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd 
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context.xsd 
    http://www.citrusframework.org/schema/config 
    http://www.citrusframework.org/schema/config/citrus-config.xsd 
    http://www.citrusframework.org/schema/ws/config 
    http://www.citrusframework.org/schema/ws/config/citrus-ws-config.xsd 
    http://www.citrusframework.org/schema/http/config 
    http://www.citrusframework.org/schema/http/config/citrus-http-config.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"> 
    (...) 
    <citrus:channel-endpoint id="fileEndpoint" channel="fileChannel"/> 
    <file:outbound-channel-adapter id="fileOutboundAdapter" 
          channel="fileChannel" 
          directory="file:/"/> 
    <si:channel id="fileChannel"/> 

任何想法我做错了什么?预先感谢。

@编辑: 我已经将spring-integration-file.jar添加到项目类路径中,但错误仍然相同。

@ Edit2: 好吧,看起来我在向类路径添加jar时弄糟了。现在我有不同的错误:

Caused by: org.xml.sax.SAXParseException; systemId: http://www.springframework.org/schema/integration/file/spring-integration-file.xsd; lineNumber: 479; columnNumber: 71; src-resolve: Cannot resolve the name 'integration:smartLifeCycleAttributeGroup' to a(n) 'attribute group' component. 

回答

1

好吧,我想通了。 首先,在向classpath正确添加spring-integration-file.jar之后,我在pom.xml中依赖版本中存在错误版本号 因此,在添加此jar之后:spring-integration-file-2.1.0.RELEASE.jar I必须将其添加到pom.xml中:

<dependency> 
    <groupId>org.springframework.integration</groupId> 
    <artifactId>spring-integration-file</artifactId> 
    <version>2.1.0.RELEASE</version> 
</dependency>