【发布时间】:2012-12-31 03:04:48
【问题描述】:
这可能是一个简单的错误配置问题,但我的 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 或骆驼方面的专家,因此将不胜感激任何帮助。 下面是我的简单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>
【问题讨论】:
标签: xml spring apache-camel xml-namespaces