我正在尝试让 CXF 端点在 Servicemix 4 上工作。我创建了一个带有 CXF 端点的 Spring 原型,并使用 Maven 成功安装了它。运行 osgi:install - s mvn: 它安装到 Servicemix 但日志显示:
Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=springdm,
config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 21 in XML document
from URL [bundle://218.0:0/META-INF/spring/camel-context.xml] is invalid; nested exception is
org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no
declaration can be found for element 'cxf:cxfEndpoint'
我之前在我的 context.xml 文件中使用以下内容在 Camel 上构建了这条路线:
<beans ...
xmlns:osgi="http://www.springframework.org/schema/osgi"
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://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.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
http://cxf.apache.org/tranposrts/camel http://cxf.apache.org/tranposrts/camel.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<cxf:cxfEndpoint id="wspoc"
address="http://localhost:8181/ws/ping"
serviceClass="net.ja.smx.springdm.PongImpl" />
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="cxf:bean:wspoc"/>
<to uri="activemq:helloQ" />
</route>
</camelContext>
这是一个工作骆驼上下文文件的克隆,但我看不出为什么 ServiceMix 在启动时会抛出错误。唯一的区别是 pom 文件不使用 CXF 作为依赖项,但它位于我从在线示例中获取的部分中。
对于任何丢失的导入或对上下文文件的更正或我应该检查的任何内容的任何指针,我将不胜感激。
非常感谢。