You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Ch...@emc.com on 2012/05/24 16:35:34 UTC

system bundle and imports

Hi,

I'm trying to come to a more elegant solution to some hibernate and osgi issues.  I'm somewhat familiar with the problems, i.e. I understand that hibernate uses some sort of dynamic class loading that short cuts the osgi mechanisms, thus leaving my annotated classes out of the picture.

One of my issues it is that I have a felix container started in an already running app.  I am exporting hibernate, among other things, from the host application to the container/system bundle so that my installed bundles can use it.  My question is, can I also configure the container/system bundle to Import stuff from the installed bundles?

Thanks,
Chad

Re: system bundle and imports

Posted by Felix Meschberger <fm...@adobe.com>.
Hi,

Am 24.05.2012 um 16:47 schrieb Marcel Offermans:

> On May 24, 2012, at 16:35 PM, <Ch...@emc.com> <Ch...@emc.com> wrote:
> 
>> I'm trying to come to a more elegant solution to some hibernate and osgi issues.  I'm somewhat familiar with the problems, i.e. I understand that hibernate uses some sort of dynamic class loading that short cuts the osgi mechanisms, thus leaving my annotated classes out of the picture.
>> 
>> One of my issues it is that I have a felix container started in an already running app.  I am exporting hibernate, among other things, from the host application to the container/system bundle so that my installed bundles can use it.  My question is, can I also configure the container/system bundle to Import stuff from the installed bundles?
> 
> No, the system bundle unfortunately cannot import anything from the installed bundles. That is a fundamental limitation you will have to live with when embedding an OSGi framework in an existing application.

But you can, of course, go the other way around: Place the libs in a shared class loader and expose them through the system bundle to the framework, e.g. using the org.osgi.framework.system.packages.extra property. This can be set just like any Export-Package header allowing to expose versioned packages into the framework.

Regards
Felix

> 
> Greetings, Marcel
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: system bundle and imports

Posted by Marcel Offermans <ma...@luminis.nl>.
On May 24, 2012, at 16:35 PM, <Ch...@emc.com> <Ch...@emc.com> wrote:

> I'm trying to come to a more elegant solution to some hibernate and osgi issues.  I'm somewhat familiar with the problems, i.e. I understand that hibernate uses some sort of dynamic class loading that short cuts the osgi mechanisms, thus leaving my annotated classes out of the picture.
> 
> One of my issues it is that I have a felix container started in an already running app.  I am exporting hibernate, among other things, from the host application to the container/system bundle so that my installed bundles can use it.  My question is, can I also configure the container/system bundle to Import stuff from the installed bundles?

No, the system bundle unfortunately cannot import anything from the installed bundles. That is a fundamental limitation you will have to live with when embedding an OSGi framework in an existing application.

Greetings, Marcel


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org