Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
framework-2.0.2
-
None
-
None
Description
The implementation of Felix.setActiveStartLevel(int) iterates over all bundles an tries to aquire the lock for each bundle. But it does not check if a bundle is (already) UNINSTALLED. If it encounters an UNINSTALLED bundle Felix.acquireBundleLock(...) will throw an IllegalStateException which will be logged and published as event.
So I guess the following code from Felix.setActiveStartLevel(int):
// Lock the current bundle.
try
catch (IllegalStateException ex)
{ fireFrameworkEvent(FrameworkEvent.ERROR, impl, ex); m_logger.log( Logger.LOG_ERROR, "Error locking " + impl._getLocation(), ex); continue; }
Should be changed to this in order to prevent unnecessary error message (log and events)
// Lock the current bundle.
try
{ acquireBundleLock(impl, Bundle.INSTALLED | Bundle.RESOLVED | Bundle.ACTIVE | Bundle.STARTING | Bundle.STOPPING); }
catch (IllegalStateException ex)
{
if ( impl.getState() != Bundle.UNINSTALLED )
continue;
}
Attachments
Issue Links
- duplicates
-
FELIX-1753 The start level should check that the bundle still exists before starting it to avoid an ugly exception
- Resolved