6 Replies Latest reply on Jul 4, 2011 9:38 PM by Freeman(Yue) Fang

    Unable to locate Spring NamespaceHandler for XML schema namespace

    Jochen Lauer Apprentice

      Hello together,

       

      I am trying to develop a camel osgi bundle with a camel processor.

      During runtime I get an exception:

       

      3.0.5.RELEASE | Loading XML bean definitions from class path resource

      22:13:00,517 | ERROR | tenerContainer-1 | DefaultErrorHandler              | ?                                   ? | 68 - org.apache.camel.camel-core

      - 2.6.0.fuse-00-00 | Failed delivery for exchangeId: ID-labo-HP-51979-1309205524745-2-5. Exhausted after delivery attempt: 1 caught: org.springframewo

      rk.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [htt

      p://camel.apache.org/schema/spring]

      Offending resource: class path resource

       

      org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML sche

      ma namespace http://camel.apache.org/schema/spring

      Offending resource: class path resource

       

              at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)[59:org.springframework.beans:3.0.5

      .RELEASE]

              at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)[59:org.springframework.beans:3.0.5.RELEASE]

              at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)[59:org.springframework.beans:3.0.5.RELEASE]

              at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:284)[59:org.springframework.bean

      s:3.0.5.RELEASE]

              at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1332)[59:org.spring

      framework.beans:3.0.5.RELEASE]

              at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325)[59:org.spring

       

      -


      My beans.xml looks like

       

       

       

       

      -


       

      and the Processor class

       

      public class SpieleSQLServiceBean implements Processor{

       

           public void process(Exchange exchange) throws Exception {

                 ApplicationContext context = new ClassPathXmlApplicationContext("META-INF/spring/beans.xml");

                 String payload = exchange.getIn().getBody(String.class);

                 DataSource ds = (DataSource)context.getBean("lw2DataSource");

                 Connection conn = ds.getConnection();

                 System.out.println("#### Connection "+ conn.toString());     

                 exchange.getIn().setBody("###################################################### Changed body");     

           }

      }

       

       

       

      Environment: fuse 4.3.1, jdk 1.6_24, windows

       

       

      My intention is to execute several sql statements (insert, update,delete) to different db tables from an incoming xml.

      Therefore for me it seems to be a possible way with the processor class.

       

      Thanks in advance

      labo