karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Javier Delgadillo <jdelgadi...@esri.com>
Subject Running Karaf 4.2.1 with OpenJDK 11
Date Fri, 30 Nov 2018 18:51:17 GMT
Hello everyone,

We’re in the process of switching our custom Karaf application to OpenJDK from Oracle JRE.
 We’ve successfully ported it to OpenJDK 8, but I’m having troubles getting it to run
using OpenJDK 11.

Summary: Building and running with OpenJDK8 works as expected.

If I build the application with OpenJDK11 and run with OpenJDK11, I see this when running
karaf.vat:
C >.\karaf.bat
karaf.bat: Enabling Java debug options: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0
and will likely be removed in a future release.
Listening for transport dt_socket at address: 5005
ERROR: Error parsing system bundle export statement: org.osgi.dto;version="1.0",org.osgi.resource;version="1.0",org.osgi.resource.dto;version="1.0";uses:="org.osgi.d
to",org.osgi.framework;version="1.8",org.osgi.framework.dto;version="1.8";uses:="org.osgi.dto",org.osgi.framework.hooks.bundle;version="1.1";uses:="org.osgi.framewor
k",org.osgi.framework.hooks.resolver;version="1.0";uses:="org.osgi.framework.wiring",org.osgi.framework.hooks.service;version="1.1";uses:="org.osgi.framework",org.os
gi.framework.hooks.weaving;version="1.1";uses:="org.osgi.framework.wiring",org.osgi.framework.launch;version="1.2";uses:="org.osgi.framework",org.osgi.framework.name
space;version="1.1";uses:="org.osgi.resource",org.osgi.framework.startlevel;version="1.0";uses:="org.osgi.framework",org.osgi.framework.startlevel.dto;version="1.0";
uses:="org.osgi.dto",org.osgi.framework.wiring;version="1.2";uses:="org.osgi.framework,org.osgi.resource",org.osgi.framework.wiring.dto;version="1.2";uses:="org.osgi
.dto,org.osgi.resource.dto",org.osgi.service.condpermadmin;version="1.1.1";uses:="org.osgi.framework,org.osgi.service.permissionadmin",org.osgi.service.packageadmin;
version="1.2";uses:="org.osgi.framework",org.osgi.service.permissionadmin;version="1.2",org.osgi.service.resolver;version="1.0";uses:="org.osgi.resource",org.osgi.se
rvice.startlevel;version="1.1";uses:="org.osgi.framework",org.osgi.service.url;version="1.0",org.osgi.util.tracker;version="1.5.1";uses:="org.osgi.framework",org.apa
che.karaf.version;version="4.2.1",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.1",org.apache.karaf.jaas.boot;uses:="javax.security.aut
h,javax.security.auth.callback,javax.security.auth.login,javax.security.auth.spi,org.osgi.framework";version="4.2.1",,org.apache.karaf.branding,
sun.misc, org.apache
.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.1, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.1,
org.apac
he.karaf.jaas.boot;uses:="javax.security.auth,javax.security.auth.callback,javax.security.auth.login,javax.security.auth.spi,org.osgi.framework";version=4.2.1,
org.a
pache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.1
org.osgi.framework.BundleException: Exported package names cannot be zero length.
        at org.apache.felix.framework.util.manifestparser.ManifestParser.normalizeExportClauses(ManifestParser.java:876)
        at org.apache.felix.framework.util.manifestparser.ManifestParser.<init>(ManifestParser.java:215)
        at org.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java:261)
        at org.apache.felix.framework.Felix.<init>(Felix.java:429)
        at org.apache.felix.framework.FrameworkFactory.newFramework(FrameworkFactory.java:28)
        at org.apache.karaf.main.Main.launch(Main.java:256)
        at org.apache.karaf.main.Main.main(Main.java:178)
Error installing bundle listed in startup.properties with url: mvn:org.apache.karaf.features/org.apache.karaf.features.extension/4.2.1
and startlevel: 1

In data/log/karaf.log, I see this:
Nov 30, 2018 9:16:56 AM org.apache.karaf.main.Main launch
INFO: Installing and starting initial bundles
Nov 30, 2018 9:16:56 AM org.apache.karaf.main.Main main
SEVERE: Could not launch framework
java.lang.RuntimeException: Error installing bundle listed in startup.properties with url:
mvn:org.apache.karaf.features/org.apache.karaf.features.extension/4.2.1 and startlevel: 1
        at org.apache.karaf.main.Main.installAndStartBundles(Main.java:550)
        at org.apache.karaf.main.Main.launch(Main.java:273)
        at org.apache.karaf.main.Main.main(Main.java:178)
Caused by: org.osgi.framework.BundleException: Could not create bundle object.
        at org.apache.felix.framework.Felix.installBundle(Felix.java:3095)
        at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:167)
        at org.apache.karaf.main.Main.installAndStartBundles(Main.java:543)
        ... 2 more
Caused by: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
        at java.base/java.util.Objects.checkIndex(Objects.java:372)
        at java.base/java.util.ArrayList.get(ArrayList.java:458)
        at org.apache.felix.framework.ExtensionManager.addExtensionBundle(ExtensionManager.java:516)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:3061)
        ... 4 more

I see the same error message after removing our new feature from the featuresBoot property
in the config etc/org.apache.karaf.features.cfg and when I replace the startup.properties
file with the one that ships with the vanilla karaf 4.2.1 distribution.  For what it’s worth,
the Export statement in output for karaf.bat belongs to the lib/goot/org.osgi.core-6.0.0.jar.

What settings can I modify to get more information about the bundle/jar file that’s causing
the IndexOutOfBoundsException showing up in the karaf.log?
--
Javer Delgadillo | Realtime GIS Engineer/ScrumMaster
Esri | 380 New York St | Redlands, CA 92373 | USA
T 909 793 2853 x1068 | jdelgadillol@esri.com | esri.com

THE
SCIENCE
OF
WHERE™

Mime
View raw message