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.

Regarding this issue, after looking at the docs for PackageAdmin.refreshPackages() it seems to be explicitly talking about what to do for updated and/or uninstalled packages. However, it is not clear if the sentences "forces the update (replacement) or removal of packages exported by the specified bundles" is only referring to bundle updated or removed packages, but it can certainly be interpreted that way, from my point of view. Read in total, the documentation is clearly talking about updated and uninstalled packages. I won't say that I know its true intent, though.

-> richard

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 <[EMAIL PROTECTED]> 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" <[EMAIL PROTECTED]>:

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



Reply via email to