10 Replies Latest reply on Dec 16, 2010 11:24 AM by John Allen

    CamelNamespaceHandler does not implement Spring NamespaceHandler interface

    John Allen Newbie

      Folks, I have a Fusesource project going on which is making use of Servicemix 4.3.0-fuse-02.00.  The project has multiple modules with Maven pom files.  I have been tasked with deploying many of the modules together as a single bundle using the maven.bundle.plugin configured with embedded transitive dependencies:





      From my perspective, this goes against the grain of Servicemix in that one would normally want small, reusable bundles.  However, from what I read this should be possible.


      I have two questions:

      1)  Is it OK to use embedded dependencies - particularly transitive?  If so, are there any watchouts?


      2)  I can't get this bundle to startup in Servicemix.  Why?  Builds, Junits, and even mvn camel:run all work perfectly using this massive bundle.  I can import the bundle fine into servicemix (without the "-s" option).  When I go to start the bundle or use the import with the "-s" option, I get this error:


      15:32:26,627 | DEBUG | ExtenderThread-7 | OsgiBundleXmlApplicationContext  | gatedExecutionApplicationContext  304 | 62 - org.springframework.context - 3.0.3.RELEASE | Pre refresh error

      org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL bundle://179.0:0/META-INF/spring/bundle-context.xml; nested exception is org.springframework.beans.FatalBeanException: Class for namespace http://camel.apache.org/schema/spring does not implement the interface

           at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)[60:org.springframework.beans:3.0.3.RELEASE]



      I've searched the web and found that this kind of things seems to be most often associated with a mismatch between Spring and Camel versions.  I get the error when I've run the osgi container as felix and equinox with no variation in results.  My bundle uses Spring 3.0.3 while Camel is 2.5.0.  I've looked in the jar file produced and confirmed that the many dependencies embedded in it only include the expected versions of Spring and Camel.  The bundle/jar seems to be internally consistent.


      Debug messages from the Servicemix log show that Servicemix is aware of multiple versions of Spring and Camel.  The Loaded schema mappings message shows multiple versions, anyway.  The Loaded NamespaceHandler mappings message shows both problematic handlers being loaded - just before the error strikes. 


      Any ideas on how to make a bundle which uses embedded resources deploy into Servicemix without this error would be appreciated as would recommendations on using embedded dependencies.


      Thank you very much for your time!


      John Allen




      Additional Info: