camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmoulliard <cmoulli...@gmail.com>
Subject Re: Camel with Spring-DM-rc1 and equinox
Date Wed, 28 May 2008 12:45:00 GMT

I try also to deploy my Camel project inside Spring-DM and I have another
errors even if I follow your recommendation. See hereafter the two cases
tested :

1) Case 1 :

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://activemq.apache.org/camel/schema/spring
       http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
	
	 <camelContext>
 <route>
  <from uri="timer://myTimer?fixedRate=true&period=2000" /> 
  <bean ref="myTransform" method="transform" /> 
  <to uri="log:ExampleRouter" /> 
  </route>
  </camelContext>
  
 <bean id="myTransform" class="org.apache.camel.impl.MyTransform">
  <property name="prefix" value="MyTransform" /> 
  </bean>
  
</beans>


Line 9 in XML document from URL
[bundleentry://12/META-INF/spring/camelservice.xml] is invalid; nested
exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid
content was found starting with element 'camelContext'. One of
'{"http://www.springframework.org/schema/beans":description,
"http://www.springframework.org/schema/beans":import,
"http://www.springframework.org/schema/beans":alias,
"http://www.springframework.org/schema/beans":bean,
WC[##other:"http://www.springframework.org/schema/beans"]}' is expected.

2) Case 2
<beans xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://activemq.apache.org/camel/schema/spring
       http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
	
	 <camelContext>
 <route>
  <from uri="timer://myTimer?fixedRate=true&period=2000" /> 
  <bean ref="myTransform" method="transform" /> 
  <to uri="log:ExampleRouter" /> 
  </route>
  </camelContext>
  
 <bean id="myTransform" class="org.apache.camel.impl.MyTransform">
  <property name="prefix" value="MyTransform" /> 
  </bean>
  
</beans>

Caused by: org.xml.sax.SAXParseException: The prefix "xsi" for attribute
"xsi:schemaLocation" associated with an element type "beans" is not bound.

So, what are the correct namespace declarations to run Camel over spring-DM
?

Charles


gnodet wrote:
> 
> You need to add the namespace declaration and schema uri, as spring use
> strict matching, which means it mandates all the schema have a valid xsd
> available.
> Take a look at the xsi:schemaLocation as in the available example:
> 
> http://svn.apache.org/repos/asf/activemq/camel/trunk/examples/camel-example-osgi/src/main/resources/META-INF/spring/camelContext.xml
> 
> On Dec 4, 2007 7:48 PM, dlaidlaw <don.laidlaw@infor.com> wrote:
> 
>>
>> I am trying to load up a CamelContext in the equinox OSGi engine using
>> Spring-DM-rc1. I have all the dependencies satisfied, with camel-core,
>> camel-spring, camel-jms and servicemix's jaxb-api bundles. All these
>> bundles
>> start OK.
>>
>> In my bundle using the Spring-DM stuff to create a spring context I
>> added:
>>
>>
>>        <bean id="jms"
>> class="org.apache.camel.component.jms.JmsComponent">
>>                <property name="connectionFactory"
>> ref="connectionFactory"/>
>>        </bean>
>>
>>        <camelContext id="camel"
>>                                xmlns="
>> http://activemq.apache.org/camel/schema/spring"
>>                                useJmx="false"
>>        >
>>                <route>
>>                        <from uri="jms:queue:test.queue.1" />
>>                        <to uri="file://test.queue.1?noop=true"/>
>>                </route>
>>        </camelContext>
>>
>> But when the bundle is loading and Spring is creating the context I get:
>>
>> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
>> Line
>> 67 in XML document from OSGi
>> res[/META-INF/spring/bundle-context.xml|61|symName=don.sample.listener]
>> 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 'camelContext'.
>>
>> For some reason, the camelContext element will not resolve.
>>
>> Any hints?
>> --
>> View this message in context:
>> http://www.nabble.com/Camel-with-Spring-DM-rc1-and-equinox-tf4944939s22882.html#a14156945
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Camel-with-Spring-DM-rc1-and-equinox-tp14156945s22882p17511812.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message