felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: Refreshing packages does not work correctly?
Date Mon, 28 Jul 2008 19:23:17 GMT
 From my interpretation of the spec, a bundle is only refreshed if it is 
pending removal. In this case OBR, is not pending removal.

For your example 2, I am pretty sure that this has been changed and that 
you are free to use uninstalled packages to resolve new dependencies. I 
am not sure if this was added in 4.1 or will be added in 4.2, but I am 
fairly certain it was changed.

-> richard

Alin Dreghiciu wrote:
> Indeed the complete refresh worked as can be seen bellow on <Example
> 1>. But that still does not comply to the specs in my view as on doing
> refresh on a bundle the framework should re-resolve the bundle. At
> least that is what I got from the specs, but the specs are not very
> clear about this. Maybe I should post a clarification issue with OSGi
> Alliance. And equinox/kf does that but they may be wrong interpreting
> the specs.
>
> In <Example 2> you can find a different case with even uninstalling
> the obr bundle and then install it again. The obr bundle still gets
> resolved. And about this the specs are clear (section 4.3.8):
> "Packages of uninstalled bundles must not be used by newly installed bundles..."
>
> <Example 1>
> -------------------
> -> ps
> START LEVEL 6
>    ID   State         Level  Name
> [   0] [Active     ] [    0] System Bundle (1.0.4)
> [   1] [Active     ] [    5] Apache Felix Bundle Repository (1.1.0.SNAPSHOT)
> [   2] [Active     ] [    1] osgi.compendium (4.0.1)
> [   3] [Active     ] [    1] Apache Felix Shell Service (1.0.1)
> [   4] [Active     ] [    1] Apache Felix Shell TUI (1.0.1)
> -> headers 1
>
> Apache Felix Bundle Repository (1)
> ----------------------------------
> Tool = Bnd-0.0.238
> Bundle-Activator = org.apache.felix.bundlerepository.Activator
> Created-By = Apache Maven Bundle Plugin
> Bnd-LastModified = 1217270914325
> Export-Service = org.osgi.service.obr.RepositoryAdmin
> Built-By = alindreghiciu
> Private-Package =
> org.apache.felix.bundlerepository,org.apache.felix.bundlerepository.metadataparser,org.apache.felix.bundlerepository.metadataparser.kxmlsax,org.kxml2.io,org.kxml2.kdom,org.kxml2.wap,org.kxml2.wap.syncml,org.kxml2.wap.wml,org.kxml2.wap.wv,org.xmlpull.v1
> Export-Package = org.osgi.service.obr;uses:="org.osgi.framework";version="1.0"
> Bundle-Version = 1.1.0.SNAPSHOT
> Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt
> Build-Jdk = 1.5.0_13
> Bundle-Source =
> http://oscar-osgi.sf.net/obr2/org.apache.felix.bundlerepository/org.apache.felix.bundlerepository-1.1.0-SNAPSHOT-src.jar
> Manifest-Version = 1.0
> Bundle-Vendor = The Apache Software Foundation
> Bundle-ManifestVersion = 2
> Bundle-Url = http://oscar-osgi.sf.net/obr2/org.apache.felix.bundlerepository/org.apache.felix.bundlerepository-1.1.0-SNAPSHOT.jar
> DynamicImport-Package = org.apache.felix.shell
> Bundle-DocURL = http://oscar-osgi.sf.net/obr2/org.apache.felix.bundlerepository/
> Import-Package =
> org.osgi.framework;version="1.3",org.osgi.service.log;version="1.3.0",org.osgi.service.obr;version="1.0"
> Bundle-Name = Apache Felix Bundle Repository
> Ignore-Package = org.xml.sax,javax.xml.parsers
> Bundle-Description = Bundle repository service.
> Bundle-SymbolicName = org.apache.felix.bundlerepository
> -> uninstall 2
> -> ps
> START LEVEL 6
>    ID   State         Level  Name
> [   0] [Active     ] [    0] System Bundle (1.0.4)
> [   1] [Active     ] [    5] Apache Felix Bundle Repository (1.1.0.SNAPSHOT)
> [   3] [Active     ] [    1] Apache Felix Shell Service (1.0.1)
> [   4] [Active     ] [    1] Apache Felix Shell TUI (1.0.1)
> -> refresh 1
> -> ps
> START LEVEL 6
>    ID   State         Level  Name
> [   0] [Active     ] [    0] System Bundle (1.0.4)
> [   1] [Active     ] [    5] Apache Felix Bundle Repository (1.1.0.SNAPSHOT)
> [   3] [Active     ] [    1] Apache Felix Shell Service (1.0.1)
> [   4] [Active     ] [    1] Apache Felix Shell TUI (1.0.1)
> -> refresh
> -> ps
> START LEVEL 6
>    ID   State         Level  Name
> [   0] [Active     ] [    0] System Bundle (1.0.4)
> [   1] [Installed  ] [    5] Apache Felix Bundle Repository (1.1.0.SNAPSHOT)
> [   3] [Active     ] [    1] Apache Felix Shell Service (1.0.1)
> [   4] [Active     ] [    1] Apache Felix Shell TUI (1.0.1)
> -> start 1
> org.osgi.framework.BundleException: Unresolved package in bundle 1:
> package; (&(package=org.osgi.service.log)(version>=1.3.0))->
>
> <Example 2>
> -------------------
> -> ps
> START LEVEL 6
>    ID   State         Level  Name
> [   0] [Active     ] [    0] System Bundle (1.0.4)
> [   1] [Active     ] [    5] Apache Felix Bundle Repository (1.1.0.SNAPSHOT)
> [   2] [Active     ] [    1] osgi.compendium (4.0.1)
> [   3] [Active     ] [    1] OPS4J Pax Url - classpath: (0.3.2.SNAPSHOT)
> [   4] [Active     ] [    1] OPS4J Pax Url - mvn: (0.3.2.SNAPSHOT)
> [   5] [Active     ] [    1] OPS4J Pax Url - war:, war-i: (0.3.2.SNAPSHOT)
> [   6] [Active     ] [    1] OPS4J Pax Url - wrap: (0.3.2.SNAPSHOT)
> [   7] [Active     ] [    1] Apache Felix Shell Service (1.0.1)
> [   8] [Active     ] [    1] Apache Felix Shell TUI (1.0.1)
> -> uninstall 2
> -> uninstall 1
> -> ps
> START LEVEL 6
>    ID   State         Level  Name
> [   0] [Active     ] [    0] System Bundle (1.0.4)
> [   3] [Active     ] [    1] OPS4J Pax Url - classpath: (0.3.2.SNAPSHOT)
> [   4] [Active     ] [    1] OPS4J Pax Url - mvn: (0.3.2.SNAPSHOT)
> [   5] [Active     ] [    1] OPS4J Pax Url - war:, war-i: (0.3.2.SNAPSHOT)
> [   6] [Active     ] [    1] OPS4J Pax Url - wrap: (0.3.2.SNAPSHOT)
> [   7] [Active     ] [    1] Apache Felix Shell Service (1.0.1)
> [   8] [Active     ] [    1] Apache Felix Shell TUI (1.0.1)
> -> install mvn:org.apache.felix/org.apache.felix.bundlerepository/1.1.0-SNAPSHOT
> Bundle ID: 9
> -> ps
> START LEVEL 6
>    ID   State         Level  Name
> [   0] [Active     ] [    0] System Bundle (1.0.4)
> [   3] [Active     ] [    1] OPS4J Pax Url - classpath: (0.3.2.SNAPSHOT)
> [   4] [Active     ] [    1] OPS4J Pax Url - mvn: (0.3.2.SNAPSHOT)
> [   5] [Active     ] [    1] OPS4J Pax Url - war:, war-i: (0.3.2.SNAPSHOT)
> [   6] [Active     ] [    1] OPS4J Pax Url - wrap: (0.3.2.SNAPSHOT)
> [   7] [Active     ] [    1] Apache Felix Shell Service (1.0.1)
> [   8] [Active     ] [    1] Apache Felix Shell TUI (1.0.1)
> [   9] [Installed  ] [    5] Apache Felix Bundle Repository (1.1.0.SNAPSHOT)
> -> start 9
> -> ps
> START LEVEL 6
>    ID   State         Level  Name
> [   0] [Active     ] [    0] System Bundle (1.0.4)
> [   3] [Active     ] [    1] OPS4J Pax Url - classpath: (0.3.2.SNAPSHOT)
> [   4] [Active     ] [    1] OPS4J Pax Url - mvn: (0.3.2.SNAPSHOT)
> [   5] [Active     ] [    1] OPS4J Pax Url - war:, war-i: (0.3.2.SNAPSHOT)
> [   6] [Active     ] [    1] OPS4J Pax Url - wrap: (0.3.2.SNAPSHOT)
> [   7] [Active     ] [    1] Apache Felix Shell Service (1.0.1)
> [   8] [Active     ] [    1] Apache Felix Shell TUI (1.0.1)
> [   9] [Active     ] [    5] Apache Felix Bundle Repository (1.1.0.SNAPSHOT)
> ->
>
>
> On Mon, Jul 28, 2008 at 7:43 PM, Karl Pauls <karlpauls@gmail.com> wrote:
>   
>> I think the issue is that you did only refresh the obr bundle. The other
>> bundle is still around and can be used until the framework is refreshed. Can
>> you try whether doing a complete refresh makes a difference?
>>
>> regards,
>>
>> Karl
>>
>> Von meinem iPhone gesendet
>>
>> Am 28.07.2008 um 18:58 schrieb "Alin Dreghiciu" <adreghiciu@gmail.com>:
>>
>>     
>>> Hi guys,
>>>
>>> While working on FELIX-482 I had the following (interesting) situation:
>>>
>>> 1. I had obr bundle importing org.osgi.service.log package (not optional
>>> import)
>>> 2. On a new felix instance I installed the the osgi compendium bundle
>>> that exports the log package
>>> 3. Installed obr bundle. The obr bundle gets resolved and could be
>>> started (as expected till now)
>>> 4. Uninstalled the cosgi compendium bundle
>>> 5. Refreshed packages for obr bundle. But the obr bundle was still
>>> resolved and could be started. This is the part I did not expect.
>>>
>>> Is this a known bug? Out of curiosity I did the same on equinox/kf and
>>> as expected on step 5 the obr bundle could not be resolved.
>>>
>>> --
>>> Alin Dreghiciu
>>> http://www.ops4j.org - New Energy for OSS Communities - Open
>>> Participation Software.
>>> http://www.qi4j.org - New Energy for Java - Domain Driven Development.
>>> http://malaysia.jayway.net - New Energy for Projects - Great People
>>> working on Great Projects at Great Places
>>>       
>>     
>
>
>
>   

Mime
View raw message