8 Replies Latest reply on Aug 26, 2010 3:23 AM by Willem Jiang

    Unable to locate Spring NamespaceHandler

    Peter Chandler Master

      Runtime: ServiceMix 4.2.

       

      The XML validates in a XML Editor. Any ideas why the XML is not happy in ServiceMix?

       

      Thanks,

       

      Peter.

       

      XML (application/config/spring/routes.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://www.springframework.org/schema/osgi"
          xmlns:camel="http://camel.apache.org/schema/spring"
          xsi:schemaLocation="http://www.springframework.org/schema/beans  http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
          http://www.springframework.org/schema/osgi  http://www.springframework.org/schema/osgi/spring-osgi.xsd
          http://camel.apache.org/schema/spring  http://camel.apache.org/schema/spring/camel-spring-2.2.0.xsd"> 
                
          <bean id="routesProperties"
              class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
              <property name="properties">
                  <props>
                      <prop key="topics.configuration"></prop>
                  </props>
              </property>
              <property name="systemPropertiesModeName">
                  <value>SYSTEM_PROPERTIES</value>
              </property>
          </bean>
      
      
        <camelContext id="tib" xmlns="http://camel.apache.org/schema/spring">
          <routeBuilder ref="routeBuilder"></routeBuilder>  
          <route>
               <from uri="jms:topic:TimeMy"></from>
               <to uri="mybean://controlClient?method=inputSimulationCommand"></to>
            </route>
        </camelContext>
        
         <bean id="routeBuilder" class="com.mycompamy.util.ConfigurableRouteBuilder">
            <constructor-arg value="${topics.configuration}"></constructor-arg>
         </bean>
      
      </beans>
      

       

       

      ERROR:

      Caused by: 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 [application/config/spring/routes.xml]
      
              at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
              at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
              at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
              at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:281)
              at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1294)
              at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
              at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
              at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
              at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:190)
              ... 39 more