Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-4700

Overrides and blacklist do not work by default and produce an exception

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.0
    • Component/s: None
    • Labels:
      None

      Description

      The FeaturesServiceImpl supports overrides and blacklist.
      They are configured in the Activator:
      https://github.com/apache/karaf/blob/791ebb5f908e27fa389616c8bba456cf85807f4d/features/core/src/main/java/org/apache/karaf/features/internal/osgi/Activator.java#L175

      If not configured they will default to a file which is not existing in the distribution by default:
      String overrides = getString("overrides", new File(System.getProperty("karaf.etc"), "overrides.properties").toURI().toString());
      String blacklisted = getString("blacklisted", new File(System.getProperty("karaf.etc"), "blacklisted.properties").toURI().toString());

      This causes Exceptions later down the line, e.g. here:
      https://github.com/apache/karaf/blob/b8c2617c278bb899c0af2ea1a8d2dc987f22f1cb/features/core/src/main/java/org/apache/karaf/features/internal/service/Overrides.java#L116

      The code is guarded with a null check, so there has been a possibility not to use the blacklist or override feature at all by providing them as "null".
      but the way these properties are read, they never can be null, they either refer to a file the user configured or to the default file.

      It would be great if it would be possible to turn the feature off some how.

      the best workaround right now is to add empty files, which will at least prevent the file not found exception, but it is still unnecessary file io (which admittedly is a minor concern)

        Attachments

          Activity

            People

            • Assignee:
              gnt Guillaume Nodet
              Reporter:
              fabianlange Fabian Lange
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: