camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Camel under OSGi without Spring et al.
Date Tue, 21 Jun 2011 07:39:46 GMT
Hi Christian

  You can create the OsgiDefaultCamelContext directly when you install 
the camel-core-osgi bundle.

  DefaultCamelContext camelContext = new OsgiDefaultCamelContext(context);

The CamelContextFactory is designed as a factory bean for spring to use.

Willem

On 6/21/11 1:23 PM, Christian Schneider wrote:
> 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();
> factory.setBundleContext(context);
> 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.
>
> Christian
>
>
> 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]https://issues.apache.org/jira/browse/CAMEL-3814
>>
>> 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
>>>
>>
>>
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Mime
View raw message