Hi,

I have discovered a small issue using camel DSL in combination with
osgix:cm-properties.

In my spring config file, I have created the following route

        <camel:route>
            <camel:from uri="${uriFile}" />
            <camel:setHeader headerName="origin">
                <camel:constant>file</camel:constant>
            </camel:setHeader>
            <camel:unmarshal ref="bindyDataformat" />
            <camel:to uri="${queueIn}" />
        </camel:route>

and osgix:cm-properties like this

    <osgix:cm-properties id="camelProps"
persistent-id="org.apache.camel.example.reportincident.routing">
       <prop
key="uriFile">file://c:/temp/data/?move=c:/temp/done/${file:name}</prop>
    </osgix:cm-properties>

Remark : ${file:name} is a camel property !!

but at the OSGI startup an error is generated

13:23:43,900 | ERROR | xtenderThread-20 | ContextLoaderListener            |
BundleApplicationContextListener   50 | Application context refresh failed
(OsgiBundleXmlApplicationContext(bundle=reportincident.routing,
config=osgibundle:/META-INF/spring/*.xml))
*org.springframework.beans.factory.BeanDefinitionStoreException: Invalid
bean definition with name 'camelProps' defined in null: Could not resolve
placeholder 'file:name'*
    at
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:268)
    at
org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75)
    at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479)
    at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:450)
    at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395)
    at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281)
    at
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
    at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
    at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222)
    at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175)
    at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
    at
org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)
    at java.lang.Thread.run(Thread.java:619)

Any idea to avoid this ?

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com

Reply via email to