Xsd Spring集成http出站网关
我试图使用Spring集成http出站网关,但似乎遇到了与模式相关的错误。错误是:Xsd Spring集成http出站网关,xsd,schema,spring-integration,Xsd,Schema,Spring Integration,我试图使用Spring集成http出站网关,但似乎遇到了与模式相关的错误。错误是: cvc-complex-type.3.2.2: Attribute 'expected-response-type' is not allowed to appear in element 'int-http:outbound-gateway'. sprint-servlet.xml /sprint/src/main/webapp/WEB-INF line 28 cvc-complex-type.3.2.2:
cvc-complex-type.3.2.2: Attribute 'expected-response-type' is not allowed to appear in element 'int-http:outbound-gateway'. sprint-servlet.xml /sprint/src/main/webapp/WEB-INF line 28
cvc-complex-type.3.2.2: Attribute 'url' is not allowed to appear in element 'int-http:outbound-gateway'. sprint-servlet.xml /sprint/src/main/webapp/WEB-INF line 28
cvc-complex-type.3.2.2: Attribute 'http-method' is not allowed to appear in element 'int-http:outbound-gateway'. sprint-servlet.xml /sprint/src/main/webapp/WEB-INF line 28
cvc-complex-type.3.2.2: Attribute 'reply-timeout' is not allowed to appear in element 'int-http:outbound-gateway'. sprint-servlet.xml /sprint/src/main/webapp/WEB-INF line 28
XSD似乎不接受这些属性。然而,我只是从Spring集成文档中复制/粘贴了这个。以下是我的XML配置文件的相关部分:
<?xml version="1.0" encoding="UTF-8"?>
<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-http="http://www.springframework.org/schema/integration/http"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
<!-- Spring Integration stuff -->
<int:channel id="requests">
</int:channel>
<int:channel id="replies"/>
<int-http:outbound-gateway id="example"
request-channel="requests"
url="http://localhost/test"
http-method="POST"
expected-response-type="java.lang.String"
charset="UTF-8"
reply-timeout="1234"
reply-channel="replies"/>
有没有什么明显的事情是我做错了
谢谢,
Tim将
spring集成http
和spring集成核心添加到依赖项中
应该可以工作我没有使用STS-我使用的是标准的EclipseIDE。我不确定STS是否有助于类路径,但我就是不能让它为我工作。最后我不得不从.jar文件中提取XSD并自己托管它们。希望SpringIntegration的好心人不久会在Spring站点上发布最新的XSD。不过,在此之前,我已经找到了一个解决办法。我也遇到了同样的问题,并在这里找到了答案
基本上,没有版本的模式是1.0版模式。将您的模式指向您的spring集成版本,如下所示
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration-4.1.xsd
http://www.springframework.org/schema/integration/http
http://www.springframework.org/schema/integration/http/spring-integration-http-4.1.xsd
这是来自STS还是在应用程序运行之后的问题?并确保使用正确的Spring集成版本:您需要将Spring集成JAR放在类路径(http和core)上。我曾尝试产生相同的问题,但仅在“回复超时”属性上发现错误。顺便问一下,您使用的是哪一版本的Spring集成?大家好,我正在使用以下版本的Spring-3.0.2.0版本。当我尝试创建一个基于Java的应用程序(也就是带有“main”的应用程序)时,我得到一个XSD错误,所以我不得不关闭验证。