On 13/08/2020 17:59, Eric Lilja wrote: > Hello, when attempting to move our existing code base from Java 8 to Java > 11, we noticed exceptions appearing in the Karaf log in our automated tests > (using Pax Exam). > > I've made a minimal test project available on github show-casing the issue: > https://github.com/elilja/java-11-runtime-issue > > Make sure JAVA_HOME is set to Java 11 JDK and simply execute "mvn clean > test" (we're using Maven 3.6.3 by the way) > > maven.compiler.source/target for this project is currently set java 11 > target, but can be set to java 8, and the issue will still appear if > using a Java 11 runtime. > > The karaf log can be found under the target folder, where the karaf > distribution is unpacked, and the exception looks like this: > > $ cat target/38ed3633-4936-4894-9334-0d1849833602/data/log/karaf.log > aug. 13, 2020 5:36:48 EM org.apache.karaf.main.Main launch > INFO: Installing and starting initial bundles > aug. 13, 2020 5:36:49 EM org.apache.karaf.main.Main launch > INFO: All initial bundles installed and set to start > aug. 13, 2020 5:36:49 EM org.apache.karaf.main.lock.SimpleFileLock lock > INFO: Trying to lock > C:\projects\java-11-runtime-issue\target\38ed3633-4936-4894-9334-0d1849833602\lock > aug. 13, 2020 5:36:49 EM org.apache.karaf.main.lock.SimpleFileLock lock > INFO: Lock acquired > aug. 13, 2020 5:36:49 EM org.apache.karaf.main.Main$KarafLockCallback > lockAcquired > INFO: Lock acquired. Setting startlevel to 100 > 2020-08-13T17:36:53,355 | ERROR | features-3-thread-1 | Felix > | 5 - org.ops4j.pax.logging.pax-logging-api - 1.11.6 | Bundle > org.apache.felix.framework [0] EventDispatcher: Error during dispatch. > (java.lang.NoClassDefFoundError: org/apache/karaf/specs/locator/OsgiLocator) > java.lang.NoClassDefFoundError: org/apache/karaf/specs/locator/OsgiLocator > at
You'll need a couple of VM options, see https://github.com/opendaylight/odlparent/blob/master/features-test/src/main/java/org/opendaylight/odlparent/featuretest/SingleFeatureTest.java#L238-L239 for an example. Regards, Robert
signature.asc
Description: OpenPGP digital signature
