没有找到camelContext的Camel Context CVC 2.4.2错误 [英] Camel Context cvc 2.4.2 error which doesnt find the camelContext

查看:137
本文介绍了没有找到camelContext的Camel Context CVC 2.4.2错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道并且经历过很多类似的问题.但是我仍然无法到达我所错过的地方.我已经在名称空间中指定了最新的xsds.当我在Web Sphere中运行时,仍然出现错误.但是我对Tomcat没有任何问题.

I know and had been through a lot of similar problems like this. But still i am not getting where i am missing out. I have specified the latest xsds in name space. Still i get the error when i run in Web Sphere. But i dont get any problems with Tomcat.

 <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:camel="http://camel.apache.org/schema/spring" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="
   http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
   http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
   http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
   http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
   http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
   http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
   http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd
">



<bean id="xRoute" class="com.tgt.test.web.routes.GetXRoute" />
<bean id="yRoute" class="com.tgt.test.web.routes.YRoute" />
<bean id="zRoute" class="com.tgt.test.web.routes.ZRoute" />
    <camelContext id="camelContext" trace="true" xmlns="http://camel.apache.org/schema/spring">
   <routeBuilder ref="xRoute"/>
    <routeBuilder ref="yRoute"/>
    <routeBuilder ref="zRoute"/>
</camelContext>

错误:由以下原因引起:org.xml.sax.SAXParseException:cvc-complex-type.2.4.c:匹配的通配符很严格,但是找不到元素'camelContext'的声明.

ERROR: Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'camelContext'.

请让我知道为什么只有wbesphere会发生这种情况,而Tomcat不会.很抱歉问了同样的问题.从昨天开始,我就伤脑筋了.谢谢

please let me know why this happens only with wbesphere but not with Tomcat. And Sorry for asking for same question.I have been breaking my head since yesterday.Thanks

推荐答案

我在Web领域RSA环境中工作.使用TOMCAT容器在NON EAR类型的项目结构中运行良好.但是当我将代码移到EAR类型的Project Structure时,发生了

I was working in Web sphere RSA Environment. It was working fine in a NON EAR type of Project Structure with TOMCAT Container. But when i moved my code to EAR type of Project Structure, It occured that

错误:原因:org.xml.sax.SAXParseException:cvc-complex-type.2.4.c:匹配的通配符是严格的,但是找不到元素'camelContext'的声明. .

ERROR: Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'camelContext'.

Spring的意思是,它在"中找到了元素çamelContext'的声明. http://camel.apache.org/schema/spring ",其中包含名称空间参考->" http://camel.apache.org/schema/spring/camel-spring.xsd "因此,我检查了骆驼sprin 2.12.1 jar中的camel-spring.xsd文件, camelContext在那里.然后,我认识到EAR无法识别骆驼弹簧罐,即使我已将它们添加到每个项目的classpath中(添加到类路径中,(属性/构建路径/添加jar)).

Which means , the Spring coudnt find a declaration for the Element çamelContext'which is supposed to be there in "http://camel.apache.org/schema/spring" which had a namespace reference -> "http://camel.apache.org/schema/spring/camel-spring.xsd" So i check the camel-spring.xsd file in camel sprin 2.12.1 jar, the camelContext was there. Then i recognized that the the camel-spring jar was not recognized by the EAR,even though i have added them to classpath (adding to class path means, (properties/build path/add jars) for each project. So the solution is,

进入EAR/META_INF并添加每个项目的类路径中所需的所有jar.

got to EAR/META_INF and add all the jars which are required in the class path for each project.

此解决方案解决了该问题.尽管这浪费了我宝贵的开发时间近48小时,但值得等待.我学到了更多.谢谢!

This solution solved the issue.Though this wasted almost 48 hours of my precious development time, it was worth the wait. I learnt more. Thanks!

这篇关于没有找到camelContext的Camel Context CVC 2.4.2错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆