Bug 457447

Summary: Unable to start reinstalled singleton-bundle
Product: [Eclipse Project] Equinox Reporter: Jan Winter <jan.winter>
Component: FrameworkAssignee: equinox.framework-inbox <equinox.framework-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: sptaszkiewicz, tjwatson
Version: 3.9.0 KeplerKeywords: needinfo
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Jan Winter CLA 2015-01-14 09:06:37 EST
If i reinstall a singleton-bundle via equinox-console 
than I got an BundleException 'Reason: Another singleton version selected ...'.

reinstall == install+uninstall+install (with -start)

===> Howto reproduce: <===

 open Console 'Host OSGi Console'
 osgi> install -start file:/my.bundle.jar
 [bundle.id]
 osgi> uninstall [bundle.id]
 osgi> install -start file:/my.bundle.jar
 BundleException ...

===> my.bundle.jar/MANIFEST.MF <====
Bundle-SymbolicName: my.bundle;singleton=true

I would expect that the 'uninstall-command' the bundle removed/deleted/... .
And next 'install-command -start' a new my.bundle installed.
Comment 1 Thomas Watson CLA 2015-01-14 10:22:00 EST
What version of Equinox are you using.  Is it the version included in Eclipse 4.2?  If so could you try on the latest release (Luna).  I suspect this is because you are not doing a refresh operation after uninstalling the bundle.  Try running 'refresh' after uninstall.  Prior to the Luna release the framework had cases where uninstalled bundles would not get auto-flushed from the system without a refresh operation.

Even in the new framework (in Luna) there are valid cases where an uninstalled bundle cannot be completely flushed from the system until a refresh operation is done.  This can happen if the uninstalled bundle exports packages and there are still one or more other bundles that either import package from the uninstalled bundle or require the uninstalled bundle.  Uninstalling a bundle in this kind of situation puts the bundle in a 'removal pending' state because we cannot yank the packages out from under the other class loaders in the framework that are still using the uninstalled bundle's content.
Comment 2 Jan Winter CLA 2015-01-14 12:52:41 EST
I using org.eclipse.osgi_3.9.1.v20140110-1610 ( kepler:( )

Thanks Thmomas, for Your quick answer.

`refresh` is no alternative. Because
1) install my.bundle_this-version.jar & uninstall
2) install my.bundle_that-version.jar

I will switch to luna as soon as possible.
Comment 3 Thomas Watson CLA 2015-01-14 13:56:13 EST
(In reply to Jan Winter from comment #2)
> I using org.eclipse.osgi_3.9.1.v20140110-1610 ( kepler:( )
> 
> Thanks Thmomas, for Your quick answer.
> 
> `refresh` is no alternative. Because
> 1) install my.bundle_this-version.jar & uninstall
> 2) install my.bundle_that-version.jar
> 

When I say refresh I mean just run the 'refresh' command after uninstall with no parameters.
Comment 4 Jan Winter CLA 2015-01-16 08:58:41 EST
`refresh` after `uninstall` not help.
Comment 5 Thomas Watson CLA 2015-01-16 11:14:15 EST
I'm not able to reproduce this (even without doing a refresh) on Kepler.  I'm using a very simple bundle though.  Could you attach a test bundle that reproduces this issue?
Comment 6 Szymon Ptaszkiewicz CLA 2015-04-23 09:42:06 EDT
Marking as WORKSFORME based on comment 5. If you can still reproduce the problem, please reopen and provide information requested in comment 5.