【发布时间】:2016-01-22 06:24:52
【问题描述】:
我正在创建以下 Camel 配置:
<?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:camel="http://camel.apache.org/schema/spring"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xsi:schemaLocation="
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
http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd">
<camelContext xmlns="http://camel.apache.org/schema/spring">
<routeContextRef ref="DoItRoute"/>
<onException id="OnException">
<exception>java.sql.SQLException</exception>
<exception>java.lang.Exception</exception>
<redeliveryPolicy maximumRedeliveries="0" />
<to id="ErrorProcessor" uri="bean:errorProcessor"/>
</onException>
<packageScan>
<package>com.myself.route.doit</package>
<excludes>*ExcludeMe*</excludes>
</packageScan>
</camelContext>
</beans>
在 Eclipse 中,当我将鼠标悬停在 <camelContext 上时,它会告诉我
Element : camelContext
Content Model : (routeContextRef? | onException? | packageScan?)*
所以我的配置似乎遵循架构。
但是,当我将它部署到 Tomcat 时,出现以下异常:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: 来自类路径资源的 XML 文档中的第 23 行 [META-INF/spring/my-route.xml] 无效;嵌套异常是 org.xml.sax.SAXParseException;行号:23;列号:20; cvc-complex-type.2.4.a:发现无效内容以 元素'packageScan'。之一 '{"http://camel.apache.org/schema/spring":onException, "http://camel.apache.org/schema/spring":onCompletion, "http://camel.apache.org/schema/spring":拦截, "http://camel.apache.org/schema/spring":interceptFrom, "http://camel.apache.org/schema/spring":interceptSendToEndpoint, "http://camel.apache.org/schema/spring":restConfiguration, “http://camel.apache.org/schema/spring”:休息, "http://camel.apache.org/schema/spring":route}' 是预期的。
这里发生了什么? Eclipse 和 Tomcat 看不同的 XSD? 我该如何解决这个问题?
【问题讨论】:
标签: eclipse spring xsd tomcat7 apache-camel