You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Saminda Abeyruwan <sa...@gmail.com> on 2008/03/25 14:13:04 UTC

Question related to version

Hi Devs,

I've read the OSGi spec to find out the version resolution to the following
scenario. Unfortunately I wouldn't find a proper solution. Please aid me
with this.

Scenario :

In bundle A, it needs to import class : foo.bar.Bar;version="[1.0, 2.1)"

In the system, it has installed and started two bundles exporting the prior
class

bundle B exports : foo.bar.Bar;version="1.2"
bundle C exports : foo.bar.Bar;version="2.0"

If bundle B and C is installed and started, and if bundle A started
thereafter, what is the version of f"oo.bar.Bar" class resolved to. I'm
facing a ClassCastException with the prior scenario. Your hint will aid me
to resolve the prior problem.

Thank you

Saminda

-- 
Saminda Abeyruwan

Senior Software Engineer
WSO2 Inc. - www.wso2.org

Re: Question related to version

Posted by "Richard S. Hall" <he...@ungoverned.org>.
All other things being equal, it will choose the highest version. If, 
however, a lower version was already resolved and in use, then it will 
choose the already in use version to avoid creating another incompatible 
class space.

-> richard

Saminda Abeyruwan wrote:
> Hi Devs,
>
> I've read the OSGi spec to find out the version resolution to the following
> scenario. Unfortunately I wouldn't find a proper solution. Please aid me
> with this.
>
> Scenario :
>
> In bundle A, it needs to import class : foo.bar.Bar;version="[1.0, 2.1)"
>
> In the system, it has installed and started two bundles exporting the prior
> class
>
> bundle B exports : foo.bar.Bar;version="1.2"
> bundle C exports : foo.bar.Bar;version="2.0"
>
> If bundle B and C is installed and started, and if bundle A started
> thereafter, what is the version of f"oo.bar.Bar" class resolved to. I'm
> facing a ClassCastException with the prior scenario. Your hint will aid me
> to resolve the prior problem.
>
> Thank you
>
> Saminda
>
>