Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-552

OSGI check broken - try to load class BundleEvent always fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.20
    • 1.21
    • Compressors
    • None

    Description

      There is a check for running in OSGI env. in ZstdUtils, BrotliUtils, LZMAUtils and XZUtils like this:

      static {
          cachedZstdAvailability = CachedAvailability.DONT_CACHE;
          try {
              Class.forName("org.osgi.framework.BundleEvent");
          } catch (final Exception ex) { // NOSONAR
              setCacheZstdAvailablity(true);
          }
      }
      

      Loading the class org.osgi.framework.BundleEvent always fails because Import-Package directive for org.osgi.framework is missing in MANIFEST.MF. Or it requires another more sophisticated approaches (https://stackoverflow.com/q/5879040/1061929).

      Tested with Eclipse 4.14 (org.eclipse.osgi_3.15.100.v20191114-1701.jar)

      Attachments

        1. commons-compress-1.21-SNAPSHOT.jar
          629 kB
          Stefan Bodewig

        Activity

          People

            Unassigned Unassigned
            mtomcat_daobi Björn Michael
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: