The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

dkssoft (1) [Avatar] Offline
We have camel based application as OSGi bundle and were able to run using [mvn camel:run] apart from deploying it as a bundle in Servicemix.

Later we moved the properties file out of bundle.For this we have used Compendium Services.This facilitates us to keep the configuration file outside the bundle (in Servicemix_HOME/etc folder).To implement this we have addded" namespace handler in the camel-context file. This namespace handler is part of Spring-DM. So now we are we forced to deploy it in OSGi container. We can't use [mvn camel:run]

Is there any way that we can run this using [mvn camel:run] without removing osgi-compendium namespace handler from camel-context file(so that we can keep the configuration file outside bundle in case when we deploy in OSGi container)?

When using [mvn camel:run], we are getting the exception:

Error occurred while running main from: org.apache.camel.spring.Main
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.apache.camel.maven.RunMojo$
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace []
Offending resource: file [D:poccamel-osgi-wkf argetclassesMETA-INFspringcamel-context.xml]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(
at org.springframework.beans.factory.parsing.ReaderContext.error(
at org.springframework.beans.factory.parsing.ReaderContext.error(
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(

Our camel-context.xml is:
<beans xmlns="" >
xmlnssmiliesi="" xmlns:osgi=""

<camelContext id="test-wkf" xmlns="">
<propertyPlaceholder id="properties" location="ref:testcfg" />
<routeBuilder ref="TestRoute" />

<osgix:cm-properties id="testcfg" persistent-id="config" />

<ctx:property-placeholder properties-ref="testcfg" />

Any help/suggestion will be highly appreciated.
davsclaus (413) [Avatar] Offline
Re: Problem with Camel,osgi-compendium and mvn camel:run
Its generally better to use the Camel mailing list / forum to get help with Camel.

This forum is for discussing the Camel in Action book.

The came:run maven goal is running Camel standalone using an embedded Jetty server. Its not an OSGi runtime.