gpt4 book ai didi

XML 未获取 标记

转载 作者:数据小太阳 更新时间:2023-10-29 02:22:16 27 4
gpt4 key购买 nike

这可能是一个简单的错误配置问题,但我的 xml 文档选取我的标签时遇到了问题。我收到错误

“在此行发现多个注释: - cvc-complex-type.2.4.c: 匹配的通配符是严格的,但找不到元素“camelContext”的声明。 - 无法为架构命名空间“http://activemq.apache.org/camel/”的元素“camelContext”找到 Spring NamespaceHandler

但是当我在命名空间中添加时,出现以下错误:

在此行发现多个注释: - cvc-complex-type.2.4.c: 匹配的通配符是严格的,但找不到元素“camelContext”的声明。 - schema_reference.4:无法读取模式文档“http://activemq.apache.org/camel/schema/spring/camel-spring.xsd”,因为 1) 无法 找到文件; 2)文档无法读取; 3) 文档的根元素不是 . - 无法为架构命名空间“http://activemq.apache.org/camel/schema/spring”的元素“camelContext”找到 Spring NamespaceHandler

谁能帮我弄清楚为什么我会遇到这两个问题?我不是 xml 或 Camel 方面的专家,所以任何帮助将不胜感激。下面是我的简单 xml 文档:

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">



<bean id="myrouter" class="org.apache.camel.example.reportincident.ReportIncidentRoutes"/>



<!-- Camel Configuration -->

<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
<routeBuilderRef ref="myrouter"/>


</camelContext>

</beans>

最佳答案

在 Camel 1.x 中,XML 的命名空间是以 activemq 开头的命名空间,例如

xmlns="http://activemq.apache.org/camel/schema/spring"

在 Camel 2.x 中,XML 的命名空间是纯 Camel,例如

http://camel.apache.org/schema/spring

由于 Camel 1.x 已停产,我假设您使用的是 Camel 2.x。如果是这样,您需要将 标记中的 namespace 更改为 2.x 样式。并删除 XML 文件顶部的旧引用。

关于XML 未获取 <camelContext> 标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14364447/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com