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

Utils ResourceBuilder should export all packages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • utils-1.11.6
    • utils-1.11.8
    • Utils
    • None

    Description

      The current utils ResourceBuilder doesn't allow to export java. packages. However, since R7, the framework is supposed to export java. packages.

      In Karaf, when we do that in system.packages, it fails with:

      org.osgi.framework.BundleException: Unable to build resource for System Bundle: Exporting java.* packages not allowed: java.applet
              at org.apache.felix.utils.resource.ResourceBuilder.build(ResourceBuilder.java:82)
              at org.apache.felix.utils.resource.ResourceBuilder.build(ResourceBuilder.java:67)
              at org.apache.karaf.features.internal.region.SubsystemResolver.prepare(SubsystemResolver.java:180)
              at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:383)
              at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
              at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: org.osgi.framework.BundleException: Exporting java.* packages not allowed: java.applet
              at org.apache.felix.utils.resource.ResourceBuilder.normalizeExportClauses(ResourceBuilder.java:709)
              at org.apache.felix.utils.resource.ResourceBuilder.doBuild(ResourceBuilder.java:206)
              at org.apache.felix.utils.resource.ResourceBuilder.build(ResourceBuilder.java:80)
              ... 9 more 

      Actually, utils should not test if package is part of java.*https://github.com/apache/felix-dev/blob/master/utils/src/main/java/org/apache/felix/utils/resource/ResourceBuilder.java#L705

       if (pkgName.startsWith("java.")) {

      Attachments

        Activity

          People

            jbonofre Jean-Baptiste Onofré
            jbonofre Jean-Baptiste Onofré
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: