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

Pax-Exam failure to Start Karaf container Java > 8

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.3.2
    • 4.2.12, 4.3.3
    • karaf
    • None
    • Pax-Exam version 4.13.4,

      Karaf version 4.3.2,

      Java 11.

    Description

      In test based on org.apache.karaf.itests.KarafTestSupport with Pax-Exam version 4.13.4, and Karaf version 4.3.2, on Java 11, Karaf fails to start with the following error:
        

      2021-05-19T04:34:09,372 | ERROR | features-3-thread-1 | Felix                            | 5 - org.ops4j.pax.logging.pax-logging-api - 2.0.9 | Bundle org.apache.felix.framework [0] EventDispatcher: Error during dispatch. (java.lang.IllegalAccessError: class org.apache.karaf.specs.activator.Activator (in unnamed module @0x3fb72de) cannot access class org.apache.karaf.specs.locator.OsgiLocator (in module java.base) because module java.base does not export org.apache.karaf.specs.locator to unnamed module @0x3fb72de)
      java.lang.IllegalAccessError: class org.apache.karaf.specs.activator.Activator (in unnamed module @0x3fb72de) cannot access class org.apache.karaf.specs.locator.OsgiLocator (in module java.base) because module java.base does not export org.apache.karaf.specs.locator to unnamed module @0x3fb72de
              at org.apache.karaf.specs.activator.Activator.register(Activator.java:125) ~[org.apache.karaf.specs.activator-4.3.2.jar:4.3.2]
              at org.apache.karaf.specs.activator.Activator.bundleChanged(Activator.java:97) ~[org.apache.karaf.specs.activator-4.3.2.jar:4.3.2]
              at org.apache.felix.framework.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:915) ~[?:?]
              at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834) ~[?:?]
              at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:516) ~[?:?]
              at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4817) ~[?:?]
              at org.apache.felix.framework.StatefulResolver.fireResolvedEvents(StatefulResolver.java:1300) ~[?:?]
              at org.apache.felix.framework.StatefulResolver.resolve(StatefulResolver.java:512) ~[?:?]
              at org.apache.felix.framework.Felix.resolveBundles(Felix.java:4327) ~[?:?]
              at org.apache.felix.framework.FrameworkWiringImpl.resolveBundles(FrameworkWiringImpl.java:133) ~[?:?]
              at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.resolveBundles(BundleInstallSupportImpl.java:244) ~[?:?]
              at org.apache.karaf.features.internal.service.FeaturesServiceImpl.resolveBundles(FeaturesServiceImpl.java:1175) ~[?:?]
              at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1027) ~[?:?]
              at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069) ~[?:?]
              at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004) ~[?:?]
              at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
              at java.lang.Thread.run(Thread.java:829) [?:?]

       Adding:
       

      new VMOption("--add-opens"),
      new VMOption("java.base/org.apache.karaf.specs.locator=ALL-UNNAMED”)

       
      Fixes the problem.

      Attachments

        Activity

          People

            ffang Freeman Yue Fang
            alex.soto Alex Soto
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: