felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: bundle.update becomes ineffective after loading class via class loader
Date Tue, 25 Jan 2011 20:16:46 GMT

On 1/25/11 15:07, Reto Bachmann-Gmuer wrote:
> On Tue, Jan 25, 2011 at 8:47 PM, Richard S. Hall<heavy@ungoverned.org>wrote:
>> On 1/25/11 14:17, Reto Bachmann-Gmuer wrote:
>>> Hello
>>> When I attempt to load a class with
>>> this.getClass.getClassLoader.load("foo.Hello") this prevents future
>>> updates
>>> of the bundle exporting foo from being effective, services in that package
>>> will not be running with the updated class until felix is restarted or
>>> packageAdmin.refreshPackages called.
>>> Is this a known problem?
>> This is not a "problem", that's how the spec defines it. If an exported
>> package is being used by some bundle, then an update to the exported bundle
>> does not take effect until it is refreshed. This allows you to do multiple
>> updates without having to refresh dependent bundles multiple times.
> Interesting. I though the client bundle would keep the old version but that
> other bundles would still get the updated version. Also I'm surprised that
> an attempt to load an inexisting class makes the bundle "using" the package
> (once the attempt to load the class terminated).

For your first comment, perhaps you should read the FAQ about updating a 


For the latter, I assume you must be using dynamic imports. Wiring is 
done at the package level, not the class level. Before attempting to 
find a class, a bundle must be wired to matching package exporter. The 
wiring happens first, there is no check in advance to make sure the 
package contains the class in question.

-> richard

> Cheers,
> Reto

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

View raw message