我一直在寻找一段时间来解决这个问题,但最终在这里问它,因为我找不到任何解决方案,到目前为止。我们有一个应用程序开发的apache Camel 与xml dsl定义,这是在旧版本的apache Camel 工作正常。我更新到最新版本3.19,并得到以下错误在部署的应用程序。
Caused by: org.xml.sax.SAXParseException; lineNumber: 35; columnNumber: 22; cvc-complex-type.3.2.2: Attribute 'uri' is not allowed to appear in element 'get'.
applicationContext.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: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://camel.apache.org/schema/spring
https://camel.apache.org/schema/spring/camel-spring-3.18.0.xsd
">
<camelContext
xmlns="http://camel.apache.org/schema/spring">
<rest path="/say">
<get uri="/hello">
<to uri="direct:hello" />
</get>
<get uri="/bye" consumes="application/json">
<to uri="direct:bye" />
</get>
<post uri="/bye">
<to uri="mock:update" />
</post>
</rest>
<route>
<from uri="direct:hello" />
<transform>
<constant>Hello World</constant>
</transform>
</route>
<route>
<from uri="direct:bye" />
<transform>
<constant>Bye World</constant>
</transform>
</route>
</camelContext>
</beans>
路线的定义如official documentation所示。如有任何帮助,将不胜感激。
1条答案
按热度按时间mdfafbf11#
自Camel版本3.16.0以来,
uri
属性已重命名为path
,请参见此票证中的说明https://issues.apache.org/jira/browse/CAMEL-17673?focusedCommentId=17493997&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17493997在3.16.0之前的camel版本中
请参阅https://camel.apache.org/schema/spring/camel-spring-3.15.0.xsd
自Camel 3.16.0版起
请参阅https://camel.apache.org/schema/spring/camel-spring-3.16.0.xsd
遗憾的是,Camel文档尚未更新以反映此更改,示例仍然使用
uri
属性:https://camel.apache.org/manual/rest-dsl.html#_rest_dsl_with_xml_dsl