Felix OBR unable to pick the highest version of the packages for the secondary 
bundle dependencies
--------------------------------------------------------------------------------------------------

                 Key: FELIX-2672
                 URL: https://issues.apache.org/jira/browse/FELIX-2672
             Project: Felix
          Issue Type: Bug
          Components: Bundle Repository (OBR)
    Affects Versions: bundlerepository-1.6.4
         Environment: n/a
            Reporter: Emily Jiang


I moved up to the bundlerepository-1.6.4 from bundlerepository-1.4.1 and find 
this regression defect. The test scenario is that I have different bundles 
exports the same package with different versions.  I want to provision test.b1 
bundle. This bundle imports a package test.b2 exported by the bundle of 
test.b2. There are three test.b2 bundles export the package of test.b2 under 
different version. According to resolving rules and following repository xml, 
the bundle test.b1 with version 1.1.0 and test.b2 with version 1.1.0 should be 
intalled. However, the resolving result is the test.b1 with version 1.1.0 and 
test.b2 with version 1.0.0. The repository xml was read by repository admin and 
then add to the list of the repositories when it performs provisioning. 


Repository xml:
<resource id="test.b1/1.0.0" presentationname="Bundles Plug-in" 
symbolicname="test.b1" 
uri="file:/test/was/profiles/AppSrv01/config/bundleRepository/test.b1_1.0.0.jar"
 version="1.0.0">
<capability name="bundle">
<p n="presentationname" v="Bundles Plug-in"></p>
<p n="version" t="version" v="1.0.0"></p>
<p n="symbolicname" v="test.b1"></p>
<p n="Bundle-ManifestVersion" v="2"></p>
<p n="mandatory" v=""></p>
</capability>
<capability name="package">
<p n="package" v="test.b1"></p>
<p n="version" t="version" v="1.0.0"></p>
<p n="bundle-symbolic-name" v="test.b1"></p>
<p n="bundle-version" t="version" v="1.0.0"></p>
<p n="mandatory" v=""></p>
</capability>
<capability name="service">
<p n="service" v="service"></p>
<p n="osgi.service.blueprint.compname" v="instance"></p>
<p n="objectClass" t="set" v="test.b1.B1Service"></p>
<p n="service.ranking" v="0"></p>
<p n="mandatory" v=""></p>
</capability>
<require extend="false" 
filter="(&amp;(package=org.osgi.framework)(version>=0.0.0))" multiple="false" 
name="package" optional="false">Requires package with attributes 
{package=org.osgi.framework, version=0.0.0}</require>
<require extend="false" 
filter="(&amp;(package=org.osgi.util.tracker)(version>=1.4.0))" 
multiple="false" name="package" optional="false">Requires package with 
attributes {package=org.osgi.util.tracker, version=1.4.0}</require>
<require extend="false" 
filter="(&amp;(package=test.b2)(version>=1.0.0)(version&lt;=1.0.0))" 
multiple="false" name="package" optional="false">Requires package with 
attributes {package=test.b2, version=[1.0.0,1.0.0]}</require>
<require extend="false" 
filter="(&amp;(service=service)(objectClass=test.b2.B2Service)(mandatory:&lt;*service))"
 multiple="false" name="service" optional="false">Requires service with 
attributes {service=service, objectClass=test.b2.B2Service}</require>

</resource>

<resource id="test.b2/1.0.0" presentationname="Bundles Plug-in" 
symbolicname="test.b2" 
uri="file:/test/was/profiles/AppSrv01/config/bundleRepository/test.b2_1.0.0.jar"
 version="1.0.0">
<capability name="bundle">
<p n="presentationname" v="Bundles Plug-in"></p>
<p n="version" t="version" v="1.0.0"></p>
<p n="symbolicname" v="test.b2"></p>
<p n="Bundle-ManifestVersion" v="2"></p>
<p n="mandatory" v=""></p>
</capability>
<capability name="package">
<p n="package" v="test.b2"></p>
<p n="version" t="version" v="1.0.0"></p>
<p n="bundle-symbolic-name" v="test.b2"></p>
<p n="bundle-version" t="version" v="1.0.0"></p>
<p n="mandatory" v=""></p>
</capability>
<capability name="service">
<p n="service" v="service"></p>
<p n="osgi.service.blueprint.compname" v="instance"></p>
<p n="objectClass" t="set" v="test.b2.B2Service"></p>
<p n="service.ranking" v="0"></p>
<p n="mandatory" v=""></p>
</capability>
<require extend="false" 
filter="(&amp;(package=org.osgi.framework)(version>=0.0.0))" multiple="false" 
name="package" optional="false">Requires package with attributes 
{package=org.osgi.framework, version=0.0.0}</require>
<require extend="false" 
filter="(&amp;(package=test.provisionbundle)(version>=1.0.0)(version&lt;=2.0.0)(!(version=2.0.0)))"
 multiple="false" name="package" optional="false">Requires package with 
attributes {package=test.provisionbundle, version=[1.0.0,2.0.0)}</require>
<require extend="false" 
filter="(&amp;(package=test.usebundle)(version>=1.0.0)(version&lt;=2.0.0)(!(version=2.0.0)))"
 multiple="false" name="package" optional="false">Requires package with 
attributes {package=test.usebundle, version=[1.0.0,2.0.0)}</require>
</resource>
<resource id="test.b2/1.0.2" presentationname="Bundles Plug-in" 
symbolicname="test.b2" 
uri="file:/test/was/profiles/AppSrv01/config/bundleRepository/test.b2_1.0.2.jar"
 version="1.0.2">
<capability name="bundle">
<p n="presentationname" v="Bundles Plug-in"></p>
<p n="version" t="version" v="1.0.2"></p>
<p n="symbolicname" v="test.b2"></p>
<p n="Bundle-ManifestVersion" v="2"></p>
<p n="mandatory" v=""></p>
</capability>
<capability name="package">
<p n="package" v="test.b2"></p>
<p n="version" t="version" v="1.0.2"></p>
<p n="bundle-symbolic-name" v="test.b2"></p>
<p n="bundle-version" t="version" v="1.0.2"></p>
<p n="mandatory" v=""></p>
</capability>
<capability name="service">
<p n="service" v="service"></p>
<p n="osgi.service.blueprint.compname" v="instance"></p>
<p n="objectClass" t="set" v="test.b2.B2Service"></p>
<p n="service.ranking" v="0"></p>
<p n="mandatory" v=""></p>
</capability>
<require extend="false" 
filter="(&amp;(package=org.osgi.framework)(version>=0.0.0))" multiple="false" 
name="package" optional="false">Requires package with attributes 
{package=org.osgi.framework, version=0.0.0}</require>
<require extend="false" 
filter="(&amp;(package=test.provisionbundle)(version>=1.0.0)(version&lt;=2.0.0)(!(version=2.0.0)))"
 multiple="false" name="package" optional="false">Requires package with 
attributes {package=test.provisionbundle, version=[1.0.0,2.0.0)}</require>
<require extend="false" 
filter="(&amp;(package=test.usebundle)(version>=1.0.0)(version&lt;=2.0.0)(!(version=2.0.0)))"
 multiple="false" name="package" optional="false">Requires package with 
attributes {package=test.usebundle, version=[1.0.0,2.0.0)}</require>
</resource>


<resource id="test.b1/2.0.0" presentationname="Bundles Plug-in" 
symbolicname="test.b1" 
uri="file:/test/was/profiles/AppSrv01/config/bundleRepository/test.b1_2.0.0.jar"
 version="2.0.0">
<capability name="bundle">
<p n="presentationname" v="Bundles Plug-in"></p>
<p n="version" t="version" v="2.0.0"></p>
<p n="symbolicname" v="test.b1"></p>
<p n="Bundle-ManifestVersion" v="2"></p>
<p n="mandatory" v=""></p>
</capability>
<capability name="package">
<p n="package" v="test.b1"></p>
<p n="version" t="version" v="2.0.0"></p>
<p n="bundle-symbolic-name" v="test.b1"></p>
<p n="bundle-version" t="version" v="2.0.0"></p>
<p n="mandatory" v=""></p>
</capability>
<capability name="service">
<p n="service" v="service"></p>
<p n="osgi.service.blueprint.compname" v="instance"></p>
<p n="objectClass" t="set" v="test.b1.B1Service"></p>
<p n="service.ranking" v="0"></p>
<p n="mandatory" v=""></p>
</capability>
<require extend="false" 
filter="(&amp;(package=org.osgi.framework)(version>=0.0.0))" multiple="false" 
name="package" optional="false">Requires package with attributes 
{package=org.osgi.framework, version=0.0.0}</require>
<require extend="false" 
filter="(&amp;(package=org.osgi.util.tracker)(version>=1.4.0))" 
multiple="false" name="package" optional="false">Requires package with 
attributes {package=org.osgi.util.tracker, version=1.4.0}</require>
<require extend="false" filter="(&amp;(package=test.b2)(version>=2.0.0))" 
multiple="false" name="package" optional="false">Requires package with 
attributes {package=test.b2, version=2.0.0}</require>
<require extend="false" 
filter="(&amp;(service=service)(objectClass=test.b2.B2Service)(mandatory:&lt;*service))"
 multiple="false" name="service" optional="false">Requires service with 
attributes {service=service, objectClass=test.b2.B2Service}</require>

</resource>

<resource id="test.b1/1.0.1" presentationname="Bundles Plug-in" 
symbolicname="test.b1" 
uri="file:/test/was/profiles/AppSrv01/config/bundleRepository/test.b1_1.0.1.jar"
 version="1.0.1">
<capability name="bundle">
<p n="presentationname" v="Bundles Plug-in"></p>
<p n="version" t="version" v="1.0.1"></p>
<p n="symbolicname" v="test.b1"></p>
<p n="Bundle-ManifestVersion" v="2"></p>
<p n="mandatory" v=""></p>
</capability>
<capability name="package">
<p n="package" v="test.b1"></p>
<p n="version" t="version" v="1.0.1"></p>
<p n="bundle-symbolic-name" v="test.b1"></p>
<p n="bundle-version" t="version" v="1.0.1"></p>
<p n="mandatory" v=""></p>
</capability>
<capability name="service">
<p n="service" v="service"></p>
<p n="osgi.service.blueprint.compname" v="instance"></p>
<p n="objectClass" t="set" v="test.b1.B1Service"></p>
<p n="service.ranking" v="0"></p>
<p n="mandatory" v=""></p>
</capability>
<require extend="false" 
filter="(&amp;(package=org.osgi.framework)(version>=0.0.0))" multiple="false" 
name="package" optional="false">Requires package with attributes 
{package=org.osgi.framework, version=0.0.0}</require>
<require extend="false" 
filter="(&amp;(package=org.osgi.util.tracker)(version>=1.4.0))" 
multiple="false" name="package" optional="false">Requires package with 
attributes {package=org.osgi.util.tracker, version=1.4.0}</require>
<require extend="false" 
filter="(&amp;(package=test.b2)(version>=1.0.0)(version&lt;=1.0.1))" 
multiple="false" name="package" optional="false">Requires package with 
attributes {package=test.b2, version=[1.0.0,1.0.1]}</require>
<require extend="false" 
filter="(&amp;(service=service)(objectClass=test.b2.B2Service)(mandatory:&lt;*service))"
 multiple="false" name="service" optional="false">Requires service with 
attributes {service=service, objectClass=test.b2.B2Service}</require>

</resource>


<resource id="test.usebundle/1.0.0" presentationname="Bundles Plug-in" 
symbolicname="test.usebundle" 
uri="file:/test/was/profiles/AppSrv01/config/bundleRepository/test.usebundle_1.0.0.jar"
 version="1.0.0">
<capability name="bundle">
<p n="presentationname" v="Bundles Plug-in"></p>
<p n="version" t="version" v="1.0.0"></p>
<p n="symbolicname" v="test.usebundle"></p>
<p n="Bundle-ManifestVersion" v="2"></p>
<p n="mandatory" v=""></p>
</capability>
<capability name="package">
<p n="package" v="test.usebundle"></p>
<p n="version" t="version" v="1.0.0"></p>
<p n="bundle-symbolic-name" v="test.usebundle"></p>
<p n="bundle-version" t="version" v="1.0.0"></p>
<p n="mandatory" v=""></p>
</capability>
<require extend="false" 
filter="(&amp;(package=org.osgi.framework)(version>=0.0.0))" multiple="false" 
name="package" optional="false">Requires package with attributes 
{package=org.osgi.framework, version=0.0.0}</require>

</resource>

<resource id="test.provisionbundle/1.0.0" presentationname="Bundles Plug-in" 
symbolicname="test.provisionbundle" 
uri="file:/test/was/profiles/AppSrv01/config/bundleRepository/test.provisionbundle_1.0.0.jar"
 version="1.0.0">
<capability name="bundle">
<p n="presentationname" v="Bundles Plug-in"></p>
<p n="version" t="version" v="1.0.0"></p>
<p n="symbolicname" v="test.provisionbundle"></p>
<p n="Bundle-ManifestVersion" v="2"></p>
<p n="mandatory" v=""></p>
</capability>
<capability name="package">
<p n="package" v="test.provisionbundle"></p>
<p n="version" t="version" v="1.0.0"></p>
<p n="bundle-symbolic-name" v="test.provisionbundle"></p>
<p n="bundle-version" t="version" v="1.0.0"></p>
<p n="mandatory" v=""></p>
</capability>
<require extend="false" 
filter="(&amp;(package=org.osgi.framework)(version>=0.0.0))" multiple="false" 
name="package" optional="false">Requires package with attributes 
{package=org.osgi.framework, version=0.0.0}</require>
</resource>

By the way, the correct result was produced if I read the repository xml into 
an ByteArrayOutputStream and then use datamodel helper to get a repository 
object and then pass to obr provisioner. Not sure whether this works by 
accident.
Please let me know if you need any more information.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to