You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Naira & Kobo <le...@gmail.com> on 2010/09/23 19:30:58 UTC

Cannot find the declaration of element 'routeContext'.

Hi,

I keep getting this error when I try to start camel application.
Offending resource: URL
[bundle://224.0:0/META-INF/spring/camel-context.xml]; nested exception is
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
2 in XML document from OSGi
resource[file:///D:/progress/apache-servicemix-4.3.0-fuse-00-00/data/routes/routes.xml|bnd.id=224|bnd.sym=asdddd-bundle]
is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1:
Cannot find the declaration of element 'routeContext'.

See my config below:

routes.xml
<?xml version="1.0" encoding="UTF-8"?>
<routeContext id="kimonoRoutes"
xmlns="http://camel.apache.org/schema/spring">
    <route>
       <from uri="jms:queue:src">
       <to uri="jms:queue:dst">
    </route>
</routeContext>

camelContext.xml
<?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:osgi="http://camel.apache.org/schema/osgi"
        xmlns:beans="http://www.springframework.org/schema/beans"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
       http://camel.apache.org/schema/osgi
http://camel.apache.org/schema/osgi/camel-osgi.xsd
       http://www.springframework.org/schema/osgi-compendium
http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
       http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
       http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

<osgi:camelContext xmlns="http://camel.apache.org/schema/spring"
trace="true">    
    <route>  
    </route>   
</osgi:camelContext>
</beans>


What could be wrong?
-- 
View this message in context: http://camel.465427.n5.nabble.com/Cannot-find-the-declaration-of-element-routeContext-tp2851604p2851604.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Cannot find the declaration of element 'routeContext'.

Posted by Naira & Kobo <le...@gmail.com>.
See sample route snippet I wrote that worked for me:

<?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:osgi="http://camel.apache.org/schema/osgi" 
        xmlns:beans="http://www.springframework.org/schema/beans" 
       xsi:schemaLocation=" 
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
       http://camel.apache.org/schema/osgi
http://camel.apache.org/schema/osgi/camel-osgi.xsd
       http://www.springframework.org/schema/osgi-compendium
http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
       http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
       http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> 


<!-- #################  Rule Engines ############### -->
<routeContext id="ruleEngines"
xmlns="http://camel.apache.org/schema/spring">
    <!-- preprocessor Rule Engine -->
    <route id="preprocessorRuleEngine">
        <from uri="localRequestJMS:queue:preprocessorRuleEngine"/>
		<bean ref="rulesEngine" method="preprocess"/>
    	<onException>
    	    <exception>java.lang.Exception</exception>
    	    <handled><constant>true</constant></handled>
    	    <to uri="localRequestJMS:queue:processorRuleEngine"/>
        </onException>
    </route>    
</routeContext>
</beans>	

-- 
View this message in context: http://camel.465427.n5.nabble.com/Cannot-find-the-declaration-of-element-routeContext-tp2851604p3261545.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Cannot find the declaration of element 'routeContext'.

Posted by Naira & Kobo <le...@gmail.com>.
Thanks, That worked.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Cannot-find-the-declaration-of-element-routeContext-tp2851604p2851660.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Cannot find the declaration of element 'routeContext'.

Posted by Claus Ibsen <cl...@gmail.com>.
Check this link for an example
http://camel.apache.org/configuring-camel.html

On Thu, Sep 23, 2010 at 7:44 PM, Naira & Kobo <le...@gmail.com> wrote:
>
> Thanks for the quick response.
>
> I added the following namespace and I put routeContext in a beans root
> element
>
> <?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:osgi="http://camel.apache.org/schema/osgi"
>        xmlns:beans="http://www.springframework.org/schema/beans"
>       xsi:schemaLocation="
>       http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>       http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd
>       http://camel.apache.org/schema/osgi
> http://camel.apache.org/schema/osgi/camel-osgi.xsd
>       http://www.springframework.org/schema/osgi-compendium
> http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
>       http://www.springframework.org/schema/osgi
> http://www.springframework.org/schema/osgi/spring-osgi.xsd
>       http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context.xsd
>       http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>
> <routeContext id="kimonoRoutes"
> xmlns="http://camel.apache.org/schema/spring">
> <route>
>         <from uri="jms:queue:src">
>         <to uri="jms:queue:dst">
> </route>
> </routeContext>
> </beans>
>
>
> And I still have the following errors:
>
>
> Offending resource: URL
> [bundle://224.0:0/META-INF/spring/camel-context.xml]; nested exception is
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 17 in XML document from OSGi
> resource[file:///D:/progress/apache-servicemix-4.3.0-fuse-00-00/data/routes/routes.xml|bnd.id=224|bnd.sym=processor-bundle]
> is invalid; nested exception is org.xml.sax.SAXParseException:
> cvc-complex-type.2.4.b: The content of element 'routeContext' is not
> complete. One of '{"http://camel.apache.org/schema/spring":route}' is
> expected.
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Cannot-find-the-declaration-of-element-routeContext-tp2851604p2851631.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
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

Re: Cannot find the declaration of element 'routeContext'.

Posted by Naira & Kobo <le...@gmail.com>.
Thanks for the quick response.

I added the following namespace and I put routeContext in a beans root
element

<?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:osgi="http://camel.apache.org/schema/osgi" 
        xmlns:beans="http://www.springframework.org/schema/beans" 
       xsi:schemaLocation=" 
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
       http://camel.apache.org/schema/osgi
http://camel.apache.org/schema/osgi/camel-osgi.xsd
       http://www.springframework.org/schema/osgi-compendium
http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
       http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
       http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> 

<routeContext id="kimonoRoutes"
xmlns="http://camel.apache.org/schema/spring">
<route> 
         <from uri="jms:queue:src"> 
         <to uri="jms:queue:dst"> 
</route>     
</routeContext>
</beans>


And I still have the following errors:


Offending resource: URL
[bundle://224.0:0/META-INF/spring/camel-context.xml]; nested exception is
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
17 in XML document from OSGi
resource[file:///D:/progress/apache-servicemix-4.3.0-fuse-00-00/data/routes/routes.xml|bnd.id=224|bnd.sym=processor-bundle]
is invalid; nested exception is org.xml.sax.SAXParseException:
cvc-complex-type.2.4.b: The content of element 'routeContext' is not
complete. One of '{"http://camel.apache.org/schema/spring":route}' is
expected.

-- 
View this message in context: http://camel.465427.n5.nabble.com/Cannot-find-the-declaration-of-element-routeContext-tp2851604p2851631.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Cannot find the declaration of element 'routeContext'.

Posted by Claus Ibsen <cl...@gmail.com>.
You need to have the XML namespace stuff in the top of both XML files.


On Thu, Sep 23, 2010 at 7:30 PM, Naira & Kobo <le...@gmail.com> wrote:
>
> Hi,
>
> I keep getting this error when I try to start camel application.
> Offending resource: URL
> [bundle://224.0:0/META-INF/spring/camel-context.xml]; nested exception is
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 2 in XML document from OSGi
> resource[file:///D:/progress/apache-servicemix-4.3.0-fuse-00-00/data/routes/routes.xml|bnd.id=224|bnd.sym=asdddd-bundle]
> is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1:
> Cannot find the declaration of element 'routeContext'.
>
> See my config below:
>
> routes.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <routeContext id="kimonoRoutes"
> xmlns="http://camel.apache.org/schema/spring">
>    <route>
>       <from uri="jms:queue:src">
>       <to uri="jms:queue:dst">
>    </route>
> </routeContext>
>
> camelContext.xml
> <?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:osgi="http://camel.apache.org/schema/osgi"
>        xmlns:beans="http://www.springframework.org/schema/beans"
>       xsi:schemaLocation="
>       http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>       http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd
>       http://camel.apache.org/schema/osgi
> http://camel.apache.org/schema/osgi/camel-osgi.xsd
>       http://www.springframework.org/schema/osgi-compendium
> http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
>       http://www.springframework.org/schema/osgi
> http://www.springframework.org/schema/osgi/spring-osgi.xsd
>       http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context.xsd
>       http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>
> <osgi:camelContext xmlns="http://camel.apache.org/schema/spring"
> trace="true">
>    <route>
>    </route>
> </osgi:camelContext>
> </beans>
>
>
> What could be wrong?
> --
> View this message in context: http://camel.465427.n5.nabble.com/Cannot-find-the-declaration-of-element-routeContext-tp2851604p2851604.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
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