camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pete Mueller <p...@routecloud.com>
Subject Re: Errors parsing camel-context.xml
Date Fri, 04 Dec 2009 23:14:23 GMT

@william, @Claus
Thank you for these tips.  I have solved part of this issue.  I did need to
change the element to <camel:json>

However, I am still getting the same type of error on the
<context:property-placeholder> element.  I took this example from the camel
tutorial (pt 2).

<context:property-placeholder properties-ref="camelProps"
placeholderPrefix="#{" placeholderSuffix="}" />

Looking at the online XSD
(http://www.springframework.org/schema/context/spring-context.xsd) There is
no listing for "placeholderPrefix"or "placeholderSuffix".  Which leads me to
the belief the tutorial is using a different schema.  Any idea which one?

I am using Karaf 1.0.0, Camel 2.0, Spring 2.5.6.SEC01

-pete

p.s. I am guessing that the tutorial assumed a ServiceMix 4.0 installation.
I have successfully gotten Camel/ActiveMQ/Hibernate/etc working in
out-of-box Karaf 1.0 and my feature file looks fairly different than the
tutorial.   I'd be happy to share it with those interested, or attach it to
the tutorial, if someone would enlighten me on the best way to do that.



Claus Ibsen-2 wrote:
> 
> On Fri, Dec 4, 2009 at 2:25 AM, Willem Jiang <willem.jiang@gmail.com>
> wrote:
>> Which version of ServiceMix are you using?
>> Can you past your camel-context file?
>>
>> Maybe you are not using a right version of camel-spring schema ?
>>
> 
> Yeah I think some of the data formats got cleaned up in 2.1. And json
> could very well be one of them.
> So make sure to use the XSD version that matches the version of Camel.
> 
> And beware some IDE tools will use the online XSD which is SNAPSHOT based.
> You should really use the XSD which is located in camel-spring.jar you
> are using.
> 
> 
> What you can always do is to declare the data format in the top
> 
> <dataFormats>
>    <json id="myJson" .../>
> </dataFormat>
> 
> And then refer to it in the route
> 
> <marshal id="myJson"/>
> 
> 
>> Willem
>>
>> Pete Mueller wrote:
>>>
>>> Hello,
>>> I am receiving the following error trying to start up my camel routing
>>> bundle with a camel-context.xml in it.
>>> The error is:
>>> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
>>> Line
>>> 16 in XML document from URL
>>> [bundle://135.0:0/META-INF/spring/camel-context.xml] is invalid; nested
>>> exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.a:
>>> Invalid
>>> content was found starting with element 'json'. One of
>>> '{"http://camel.apache.org/schema/spring":artixDS,
>>> "http://camel.apache.org/schema/spring":bindy,
>>> "http://camel.apache.org/schema/spring":csv,
>>> "http://camel.apache.org/schema/spring":flatpack,
>>> "http://camel.apache.org/schema/spring":gzip,
>>> "http://camel.apache.org/schema/spring":hl7,
>>> "http://camel.apache.org/schema/spring":jaxb,
>>> "http://camel.apache.org/schema/spring":json,
>>> "http://camel.apache.org/schema/spring":rss,
>>> "http://camel.apache.org/schema/spring":secureXML,
>>> "http://camel.apache.org/schema/spring":serialization,
>>> "http://camel.apache.org/schema/spring":string,
>>> "http://camel.apache.org/schema/spring":tidyMarkup,
>>> "http://camel.apache.org/schema/spring":xmlBeans,
>>> "http://camel.apache.org/schema/spring":xstream,
>>> "http://camel.apache.org/schema/spring":zip}' is expected.
>>>
>>> Clearly from the error, it shows that "json" is an allowed element. but
>>> SAX
>>> says otherwise.  Any idea how to reconcile this?  I have a similar error
>>> with using the placeholderPrefix attribute inside a property-placeholder
>>> element.
>>>
>>> Thanks,
>>> -p
>>>
>>> Here are relevant portions of my camel-context.xml if it helps.  I
>>> thought
>>> perhaps I'm using the wrong schema.
>>> <?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:context="http://www.springframework.org/schema/context"
>>>        xmlns:osgi="http://www.springframework.org/schema/osgi"
>>> xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
>>>        xmlns:camel="http://camel.apache.org/schema/spring"
>>>
>>>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>>> http://www.springframework.org/schema/beans/spring-beans.xsd
>>>                http://www.springframework.org/schema/context
>>> http://www.springframework.org/schema/context/spring-context.xsd
>>>                http://www.springframework.org/schema/osgi
>>> http://www.springframework.org/schema/osgi/spring-osgi.xsd
>>>                http://www.springframework.org/schema/osgi-compendium
>>>
>>> http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
>>>                http://camel.apache.org/schema/spring
>>> http://camel.apache.org/schema/spring/camel-spring.xsd">
>>>
>>>        <context:property-placeholder properties-ref="camelProps"
>>> placeholderPrefix="#{" placeholderSuffix="}" />
>>>        <camel:dataFormats>          <json id="jsonMessage"
>>> library="Jackson"
>>> unmarshalTypeName="com.routecloud.bean.Message" />
>>>  </camel:dataFormats>
>>>
>>> ...
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://old.nabble.com/Errors-parsing-camel-context.xml-tp26635732p26646469.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message