camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sumit Teke <sumit_t...@omniscient.co.in>
Subject Re: CamelServlet & spring issue
Date Tue, 15 Feb 2011 09:33:15 GMT
  Check if camel-spring is on classpath.

Thanks,
Sumit Teke

On Tuesday 15 February 2011 02:51 PM, Charles Moulliard wrote:
> Hi,
>
> When deploying a WAR project on Karaf, I get the following error :
>
> org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
> Configuration problem: Unable to locate Spring NamespaceHandler for
> XML schema namespace [http://camel.apache.org/schema/spring]
> Offending resource: class path resource [META-INF/spring/camel-context.xml]
>
> 	at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:284)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1332)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)[48:org.springframework.beans:3.0.5.RELEASE]
> 	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126)[49:org.springframework.context:3.0.5.RELEASE]
> 	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92)[49:org.springframework.context:3.0.5.RELEASE]
> 	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[49:org.springframework.context:3.0.5.RELEASE]
> 	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)[49:org.springframework.context:3.0.5.RELEASE]
> 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)[49:org.springframework.context:3.0.5.RELEASE]
> 	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)[49:org.springframework.context:3.0.5.RELEASE]
> 	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)[49:org.springframework.context:3.0.5.RELEASE]
> 	at org.apache.camel.component.servlet.CamelHttpTransportServlet.init(CamelHttpTransportServlet.java:46)[1985:org.apache.camel.camel-servlet:2.6.0]
> 	at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>
> Spring is not able to find the NameSpaceHandler for XML schema
> namespace [http://camel.apache.org/schema/spring] even if canel-core
> and camel-spring 2,6,0 are deployed on Karaf and added in the
> classpath.
>
>      <servlet>
>          <servlet-name>CamelServlet</servlet-name>
>          <display-name>Camel Http Transport Servlet</display-name>
>          <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
>          <init-param>
>              <param-name>contextConfigLocation</param-name>
>              <param-value>META-INF/spring/camel-context.xml</param-value>
>          </init-param>
>      </servlet>
>
>      <servlet-mapping>
>          <servlet-name>CamelServlet</servlet-name>
>          <url-pattern>/test/*</url-pattern>
>      </servlet-mapping>
>
> *************************************
> <?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: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://camel.apache.org/schema/spring
>     http://camel.apache.org/schema/spring/camel-spring.xsd">
>
>      <bean id="response" class="org.apache.camel.example.osgi.ResponseBean"/>
>
> 	<camelContext xmlns="http://camel.apache.org/schema/spring">
>          <route id="servlet-service">
>              <from uri="servlet:///service"/>
>              <bean ref="response"/>
>              <log message="Response send to the client !" loggingLevel="INFO"/>
>          </route>
> 	</camelContext>
> 	
> </beans>
>
>
> Any idea is welcome ?
>
> Regards,
>
> Charles Moulliard
>
> Sr. Principal Solution Architect - FuseSource
> Apache Committer
>
> Blog : http://cmoulliard.blogspot.com
> Twitter : http://twitter.com/cmoulliard
> Linkedin : http://www.linkedin.com/in/charlesmoulliard
> Skype: cmoulliard

Mime
View raw message