camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <>
Subject Re: Camel under OSGi without Spring et al.
Date Tue, 21 Jun 2011 05:23:27 GMT
Hi Willem and Mike,

I just tried to use the OsgiDefaultCamelContext in OSGi. This is not 
directly possbile as the package is not exported.
In the end I found that there is a CamelContextFactory in camel-spring 
that can be used to instantiate a camel context.

It works like this in the Activator:

CamelContextFactory factory = new CamelContextFactory();
DefaultCamelContext camelContext = factory.createContext();

I wonder a bit why this clearly OSGi specific class is in camel-spring. 
I would have expected it rather in camel-core-osgi.
In any case it seems to be the only way to instantiate the camel context 
programmatically in OSGi.


Am 21.06.2011 04:51, schrieb Willem Jiang:
> Just FYI, the camel-core-osgi bundle will be published in the Camel 
> 2.8.0. You can find more information here[1]
> [1]
> On 6/21/11 3:31 AM, Michael Furtak wrote:
>> i Don,
>> The exception was:
>> org.apache.camel.TypeConverterLoaderException: Failed to load type 
>> converters because of: Cannot find any type converter classes from 
>> the following packages: [org.apache.camel.component.file, 
>> org.apache.camel.component.bean, org.apache.camel.converter]
>> Which I assume has to do with trying to use a normal CamelContext in 
>> an OSGi environment. So, OsgiDefaultCamelContext...
>> I did come across mention of this in my troubleshooting exploration. 
>> It seems to be part of a bundle called camel-core-osgi, is that 
>> right? I don't think I have it in my 2.7.2 distribution. Is it 
>> something I need to bundle myself? I also saw mention of it being 
>> private to the Spring bundle, which is what prompted my discussion 
>> about not wanting to bring in Spring.
>> Any further info would be most helpful.
>> Thanks,
>> -Mike

Christian Schneider

Open Source Architect

View raw message