You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Henrique Viecili <he...@myreks.com> on 2012/04/26 22:55:07 UTC

FileNotFoundException using

Hi guys,

I have a servicemix-camel SU and packaged inside a have a properties file
META-INF/resources/conf/configuration.properties, and I declared it in my
camel-context.xml with:

<camel:propertyPlaceholder id="properties"
location="classpath:META-INF/resources/conf/configuration.properties"/>

when I deploy the SA in ServiceMix I get the FileNotFoundException. I've
checked the .zip packages and my SU.zip contains the property file.

I've also checked the source code for org.apache.camel.component.properties.
DefaultPropertiesResolver and the
org.apache.camel.core.osgi.OsgiClassResolver cannot find the resource. Thus
throwing the exception.

What is the right way to read these properties inside the camel-context?

*Henrique Viecili*
Myreks

Re: FileNotFoundException using

Posted by Henrique Viecili <he...@myreks.com>.
I found a workaround for this issue... although I think there's something
missing in the bundle's classloader/classpath.

Here is what I did in my camel-context.xml:

1. added xmlns:context="http://www.springframework.org/schema/context" and
xmlns:util="http://www.springframework.org/schema/util" to <beans>
declaration
2. declared the classpath bundles for the namespace handling:
    <classpath>
        <library>osgi:org.springframework.context</library>
        <library>osgi:org.springframework.beans</library>
    <classpath>
3. added these lines:
    <util:properties id="props"
location="classpath:META-INF/resources/conf/configuration.properties" />
    <context:property-placeholder properties-ref="props" />
4. and then, inside <camel:camelContext> added:
        <camel:propertyPlaceholder id="properties" location="ref:props"/>

att.
*Henrique Viecili*
*
*

On Thu, Apr 26, 2012 at 5:55 PM, Henrique Viecili <he...@myreks.com>wrote:

> Hi guys,
>
> I have a servicemix-camel SU and packaged inside a have a properties file
> META-INF/resources/conf/configuration.properties, and I declared it in my
> camel-context.xml with:
>
> <camel:propertyPlaceholder id="properties"
> location="classpath:META-INF/resources/conf/configuration.properties"/>
>
> when I deploy the SA in ServiceMix I get the FileNotFoundException. I've
> checked the .zip packages and my SU.zip contains the property file.
>
> I've also checked the source code for
> org.apache.camel.component.properties.DefaultPropertiesResolver and the
> org.apache.camel.core.osgi.OsgiClassResolver cannot find the resource.
> Thus throwing the exception.
>
> What is the right way to read these properties inside the camel-context?
>
> *Henrique Viecili*
> Myreks
>
>