0

我正在尝试了解更好的集成测试柑橘框架。我尝试创建 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]

违规资源:类路径资源 [citrus-context.xml]

这是我的 citrus-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"/>  

知道我在做什么错吗?预先感谢。

@Edit:我已将 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.
4

1 回答 1

1

好的,我想通了。首先,在将 spring-integration-file.jar 正确添加到类路径之后,我在 pom.xml 中的依赖版本号错误所以在添加了这个 jar 之后:spring-integration-file-2.1.0.RELEASE.jar 我不得不添加这对 pom.xml:

 <dependency>
    <groupId>org.springframework.integration</groupId>
    <artifactId>spring-integration-file</artifactId>
    <version>2.1.0.RELEASE</version>
</dependency>
于 2014-07-07T12:12:31.600 回答