Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-6258

The PackageAdminClassLoader cannot load classes from bundles providing older API versions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Commons ClassLoader 1.3.2
    • Fix Version/s: Commons ClassLoader 1.3.6
    • Component/s: Commons
    • Labels:
      None

      Description

      The org.apache.sling.commons.classloader.impl.PackageAdminClassLoader cannot correctly load classes that exist only in bundles providing older API implementations if another bundle providing the same API, but newer version, exists on the instance.

      Assuming bundles A and B both export org.example, A with version 1.0.0 and B with version 2.0.0, when the org.apache.sling.commons.classloader.impl.PackageAdminClassLoader is queried to resolve a class only available in A, it will try to resolve it from B. This happens because the org.apache.sling.commons.classloader.impl.PackageAdminClassLoader only checks the bundle that provides the highest API (in terms of version number) of the class' providing package.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                radu Radu Cotescu
                Reporter:
                radu Radu Cotescu
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m