In general it is possible to have multiple versions of the same
library installed, this is totally fine in OSGi and therefore also in
Karaf. Depending on your import version range you are wired to one or
the other.

I just wanted to note that if you do an update of a bundle that this
does not automatically percolate to bundles that are wired to it.

Let's say you have a bundle A that exports a.b.c.SomeClass version 1
and a bundle B that imports a.b.c.SomeClass version [1, 2).
Now if you update bundle A so that it now exports a.b.c.SomeClass
version 2 instead, bundle B will still import the a.b.c.SomeClass
version 1 from the previous revision of your bundle A. In OSGi this is
modeled via BundleRevisions. When there are still bundles wired to the
previous version of a bundle these revisions stick around, until the
bundles wired to them (in the example bundle B) are refreshed. When
you're refresh bundle B in my example here you would see that it
doesn't resolve any more since that package is now not available any
more in the range [1, 2).

However, to comment on your specific example we'd need the import
ranges as Jamie suggests.

Best regards,

David

On 9 April 2015 at 16:28, Jamie G. <jamie.goody...@gmail.com> wrote:
> Please supply your bundle wiring info - which ranges are configured?
>
> On Thu, Apr 9, 2015 at 12:50 PM, Laci Gaspar <laci...@gmail.com> wrote:
>> Hi
>> I have a question about how wiring works in karaf:
>>
>> I have the following bundles installed:
>>
>> bundle-abc, version 1.1
>> bundle-xyz, version 1.2
>> lib, version 1.1
>> lib, version 1.2
>>
>> bundle-abc uses classes from lib version 1.1
>> bundle-xyz uses classes from lib version 1.2
>> these dependencies are defined in the pom files of the bundles.
>>
>> Now if I do an update (in the karaf shell, keeping the versions) on say
>> bundle-xyz, it can happen, that bundle-xyz is wired with lib version 1.1.
>>
>> Is this normal behavior? or is it a bad Idea to have two different versions
>> of lib installed?
>>
>> Thanks
>> Laci
>>

Reply via email to