Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-2064

Felix.setActiveStartLevel(int) throws error when it encounters an UNINSTALLED bundle

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • framework-2.0.2
    • None
    • Framework
    • 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

      { 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;
      }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              alexberger Alexander Berger
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: