felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (FELIX-2064) Felix.setActiveStartLevel(int) throws error when it encounters an UNINSTALLED bundle
Date Fri, 12 Feb 2010 06:07:27 GMT

     [ https://issues.apache.org/jira/browse/FELIX-2064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Richard S. Hall resolved FELIX-2064.
------------------------------------

    Resolution: Duplicate

I believe this is a duplicate of FELIX-1753, which I've scheduled for Framework 3.0.0.

> Felix.setActiveStartLevel(int) throws error when it encounters an UNINSTALLED bundle
> ------------------------------------------------------------------------------------
>
>                 Key: FELIX-2064
>                 URL: https://issues.apache.org/jira/browse/FELIX-2064
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: felix-2.0.2
>            Reporter: Alexander Berger
>            Priority: Minor
>
> 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
>                 {
>                     acquireBundleLock(impl,
>                         Bundle.INSTALLED | Bundle.RESOLVED | Bundle.ACTIVE
>                         | Bundle.STARTING | Bundle.STOPPING);
>                 }
>                 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 ) {
> 	                    fireFrameworkEvent(FrameworkEvent.ERROR, impl, ex);
> 	                    m_logger.log(
> 	                        Logger.LOG_ERROR,
> 	                        "Error locking " + impl._getLocation(), ex);
>                     }
>                     continue;
>                 }

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


Mime
View raw message