Error parsing system bundle export statement (Java 11)

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

Error parsing system bundle export statement (Java 11)

Alex Soto
Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don’t know where it is coming from. Any ideas?

Best regards,
Alex soto




Reply | Threaded
Open this post in threaded view
|

Re: Error parsing system bundle export statement (Java 13)

Alex Soto
Anybody’s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don’t know where it is coming from. Any ideas?

Best regards,
Alex soto





Reply | Threaded
Open this post in threaded view
|

Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

Alex Soto
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)”

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody’s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don’t know where it is coming from. Any ideas?

Best regards,
Alex soto






Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

jbonofre
You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto






Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

Alex Soto
JB,  

I've added:

<dependency>
    <groupId>jakarta.xml.bind</groupId>
    <artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <scope>provided</scope>
</dependency>

But these contain javax.xml.bind not javax.xml.parsers,  do you know what to add for this?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto







Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

Alex Soto
In reply to this post by jbonofre
Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)”]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf’s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto







Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

Alex Soto
Inspecting pax-logging-api-1.11.4.jar manifest, shows: 


Import-Package: 
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.framework.wiring;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.apache.log;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,org.ops4j.pax.logging;version="[0.9.5,2.0.0)",
org.ops4j.pax.logging.avalon;version="[0.9.5,2.0.0)”


And pax-logging-api-1.11.4.jar is included in Karaf’s framework feature.  

<feature version="${project.version}" description="Karaf core feature" name="framework" hidden="true">
        <!-- persistent wiring extension -->
        <bundle start-level="1">mvn:org.apache.karaf.features/org.apache.karaf.features.extension/${project.version}</bundle>
        <!-- mvn: and wrap: url handlers -->
        <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-aether/${pax.url.version}</bundle>
        <!-- logging -->
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-log4j2/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
        <!-- config admin -->
        <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle>
        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle>
        <!-- file install -->
        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/${felix.fileinstall.version}</bundle>
        <!-- features service -->
        <bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${servicemix-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${servicemix-spec.version}</bundle>
    </feature>

I can see that package javax.xml.parsers  is in  /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/lib/jrt-fs.jar,  so it is part of the Java 13 runtime.
Why can’t Karaf resolve it then?.  Does Karaf 4.2.8 works (has been tested) with Java 13?



On Feb 20, 2020, at 4:53 PM, Alex Soto <[hidden email]> wrote:

Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)”]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf’s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto








Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

Alex Soto
I just confirmed a clean Karaf binary distribution downloaded from Karaf site, will not start with Java 13. 


Best regards,
Alex soto




On Feb 21, 2020, at 9:04 AM, Alex Soto <[hidden email]> wrote:

Inspecting pax-logging-api-1.11.4.jar manifest, shows: 


Import-Package: 
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.framework.wiring;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.apache.log;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,org.ops4j.pax.logging;version="[0.9.5,2.0.0)",
org.ops4j.pax.logging.avalon;version="[0.9.5,2.0.0)”


And pax-logging-api-1.11.4.jar is included in Karaf’s framework feature.  

<feature version="${project.version}" description="Karaf core feature" name="framework" hidden="true">
        <!-- persistent wiring extension -->
        <bundle start-level="1">mvn:org.apache.karaf.features/org.apache.karaf.features.extension/${project.version}</bundle>
        <!-- mvn: and wrap: url handlers -->
        <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-aether/${pax.url.version}</bundle>
        <!-- logging -->
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-log4j2/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
        <!-- config admin -->
        <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle>
        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle>
        <!-- file install -->
        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/${felix.fileinstall.version}</bundle>
        <!-- features service -->
        <bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${servicemix-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${servicemix-spec.version}</bundle>
    </feature>

I can see that package javax.xml.parsers  is in  /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/lib/jrt-fs.jar,  so it is part of the Java 13 runtime.
Why can’t Karaf resolve it then?.  Does Karaf 4.2.8 works (has been tested) with Java 13?



On Feb 20, 2020, at 4:53 PM, Alex Soto <[hidden email]> wrote:

Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)”]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf’s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto









Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

jbonofre
In reply to this post by Alex Soto
AFAIR, it’s a module, so you have to enable it at JDK level to use the one from the JVM (—add-module).

Let me check, I think bin/karaf already does that.

Regards
JB

Le 21 févr. 2020 à 15:04, Alex Soto <[hidden email]> a écrit :

Inspecting pax-logging-api-1.11.4.jar manifest, shows: 


Import-Package: 
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.framework.wiring;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.apache.log;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,org.ops4j.pax.logging;version="[0.9.5,2.0.0)",
org.ops4j.pax.logging.avalon;version="[0.9.5,2.0.0)”


And pax-logging-api-1.11.4.jar is included in Karaf’s framework feature.  

<feature version="${project.version}" description="Karaf core feature" name="framework" hidden="true">
        <!-- persistent wiring extension -->
        <bundle start-level="1">mvn:org.apache.karaf.features/org.apache.karaf.features.extension/${project.version}</bundle>
        <!-- mvn: and wrap: url handlers -->
        <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-aether/${pax.url.version}</bundle>
        <!-- logging -->
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-log4j2/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
        <!-- config admin -->
        <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle>
        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle>
        <!-- file install -->
        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/${felix.fileinstall.version}</bundle>
        <!-- features service -->
        <bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${servicemix-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${servicemix-spec.version}</bundle>
    </feature>

I can see that package javax.xml.parsers  is in  /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/lib/jrt-fs.jar,  so it is part of the Java 13 runtime.
Why can’t Karaf resolve it then?.  Does Karaf 4.2.8 works (has been tested) with Java 13?



On Feb 20, 2020, at 4:53 PM, Alex Soto <[hidden email]> wrote:

Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)”]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf’s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto









Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

jbonofre
In reply to this post by Alex Soto
On Jenkins we build and test using java 11. Let me fix for java 13. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 17:02, Alex Soto <[hidden email]> a ?crit :
I just confirmed a clean Karaf binary distribution downloaded from Karaf site, will not start with Java 13. 


Best regards,
Alex soto




On Feb 21, 2020, at 9:04 AM, Alex Soto <[hidden email]> wrote:

Inspecting pax-logging-api-1.11.4.jar manifest, shows: 


Import-Package: 
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.framework.wiring;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.apache.log;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,org.ops4j.pax.logging;version="[0.9.5,2.0.0)",
org.ops4j.pax.logging.avalon;version="[0.9.5,2.0.0)?


And pax-logging-api-1.11.4.jar is included in Karaf?s framework feature.  

<feature version="${project.version}" description="Karaf core feature" name="framework" hidden="true">
        <!-- persistent wiring extension -->
        <bundle start-level="1">mvn:org.apache.karaf.features/org.apache.karaf.features.extension/${project.version}</bundle>
        <!-- mvn: and wrap: url handlers -->
        <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-aether/${pax.url.version}</bundle>
        <!-- logging -->
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-log4j2/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
        <!-- config admin -->
        <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle>
        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle>
        <!-- file install -->
        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/${felix.fileinstall.version}</bundle>
        <!-- features service -->
        <bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${servicemix-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${servicemix-spec.version}</bundle>
    </feature>

I can see that package javax.xml.parsers  is in  /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/lib/jrt-fs.jar,  so it is part of the Java 13 runtime.
Why can?t Karaf resolve it then?.  Does Karaf 4.2.8 works (has been tested) with Java 13?



On Feb 20, 2020, at 4:53 PM, Alex Soto <[hidden email]> wrote:

Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf?s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto









Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

Alex Soto
It may be more than one problem,  JB, downloading a clean Karaf binary and running it on  Java 13 does not work out of the box.
Validating my application features.xml  does not work either,  karaf-maven-plugin fails to validate it for Java 13.

Best regards,
Alex soto




On Feb 21, 2020, at 12:55 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

On Jenkins we build and test using java 11. Let me fix for java 13. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 17:02, Alex Soto <[hidden email]> a ?crit :
I just confirmed a clean Karaf binary distribution downloaded from Karaf site, will not start with Java 13. 


Best regards,
Alex soto




On Feb 21, 2020, at 9:04 AM, Alex Soto <[hidden email]> wrote:

Inspecting pax-logging-api-1.11.4.jar manifest, shows: 


Import-Package: 
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.framework.wiring;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.apache.log;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,org.ops4j.pax.logging;version="[0.9.5,2.0.0)",
org.ops4j.pax.logging.avalon;version="[0.9.5,2.0.0)?


And pax-logging-api-1.11.4.jar is included in Karaf?s framework feature.  

<feature version="${project.version}" description="Karaf core feature" name="framework" hidden="true">
        <!-- persistent wiring extension -->
        <bundle start-level="1">mvn:org.apache.karaf.features/org.apache.karaf.features.extension/${project.version}</bundle>
        <!-- mvn: and wrap: url handlers -->
        <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-aether/${pax.url.version}</bundle>
        <!-- logging -->
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-log4j2/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
        <!-- config admin -->
        <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle>
        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle>
        <!-- file install -->
        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/${felix.fileinstall.version}</bundle>
        <!-- features service -->
        <bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${servicemix-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${servicemix-spec.version}</bundle>
    </feature>

I can see that package javax.xml.parsers  is in  /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/lib/jrt-fs.jar,  so it is part of the Java 13 runtime.
Why can?t Karaf resolve it then?.  Does Karaf 4.2.8 works (has been tested) with Java 13?



On Feb 20, 2020, at 4:53 PM, Alex Soto <[hidden email]> wrote:

Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf?s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api;type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto

Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

jbonofre
Let me check this out. I?m surprised. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 19:29, Alex Soto <[hidden email]> a ?crit :
It may be more than one problem,  JB, downloading a clean Karaf binary and running it on  Java 13 does not work out of the box.
Validating my application features.xml  does not work either,  karaf-maven-plugin fails to validate it for Java 13.

Best regards,
Alex soto




On Feb 21, 2020, at 12:55 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

On Jenkins we build and test using java 11. Let me fix for java 13. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 17:02, Alex Soto <[hidden email]> a ?crit :
I just confirmed a clean Karaf binary distribution downloaded from Karaf site, will not start with Java 13. 


Best regards,
Alex soto




On Feb 21, 2020, at 9:04 AM, Alex Soto <[hidden email]> wrote:

Inspecting pax-logging-api-1.11.4.jar manifest, shows: 


Import-Package: 
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.framework.wiring;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.apache.log;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,org.ops4j.pax.logging;version="[0.9.5,2.0.0)",
org.ops4j.pax.logging.avalon;version="[0.9.5,2.0.0)?


And pax-logging-api-1.11.4.jar is included in Karaf?s framework feature.  

<feature version="${project.version}" description="Karaf core feature" name="framework" hidden="true">
        <!-- persistent wiring extension -->
        <bundle start-level="1">mvn:org.apache.karaf.features/org.apache.karaf.features.extension/${project.version}</bundle>
        <!-- mvn: and wrap: url handlers -->
        <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-aether/${pax.url.version}</bundle>
        <!-- logging -->
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-log4j2/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
        <!-- config admin -->
        <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle>
        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle>
        <!-- file install -->
        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/${felix.fileinstall.version}</bundle>
        <!-- features service -->
        <bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${servicemix-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${servicemix-spec.version}</bundle>
    </feature>

I can see that package javax.xml.parsers  is in  /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/lib/jrt-fs.jar,  so it is part of the Java 13 runtime.
Why can?t Karaf resolve it then?.  Does Karaf 4.2.8 works (has been tested) with Java 13?



On Feb 20, 2020, at 4:53 PM, Alex Soto <[hidden email]> wrote:

Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf?s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api;type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto

Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

Alex Soto
I tested with JDK 11 and it worked, but it does not work with JDK 13.
I hope I can migrate to 13 directly, since it it the current version. 

With JDK 13, here is the error:


$ bin/karaf
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.felix.framework.URLHandlers (file:/Users/asoto/Downloads/apache-karaf-4.2.8/system/org/apache/felix/org.apache.felix.framework/5.6.12/org.apache.felix.framework-5.6.12.jar) to constructor sun.net.www.protocol.file.Handler()
WARNING: Please consider reporting this to the maintainers of org.apache.felix.framework.URLHandlers
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Best regards,
Alex soto




On Feb 21, 2020, at 2:10 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

Let me check this out. I?m surprised. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 19:29, Alex Soto <[hidden email]> a ?crit :
It may be more than one problem,  JB, downloading a clean Karaf binary and running it on  Java 13 does not work out of the box.
Validating my application features.xml  does not work either,  karaf-maven-plugin fails to validate it for Java 13.

Best regards,
Alex soto




On Feb 21, 2020, at 12:55 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

On Jenkins we build and test using java 11. Let me fix for java 13. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 17:02, Alex Soto <[hidden email]> a ?crit :
I just confirmed a clean Karaf binary distribution downloaded from Karaf site, will not start with Java 13. 


Best regards,
Alex soto




On Feb 21, 2020, at 9:04 AM, Alex Soto <[hidden email]> wrote:

Inspecting pax-logging-api-1.11.4.jar manifest, shows: 


Import-Package: 
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.framework.wiring;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.apache.log;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,org.ops4j.pax.logging;version="[0.9.5,2.0.0)",
org.ops4j.pax.logging.avalon;version="[0.9.5,2.0.0)?


And pax-logging-api-1.11.4.jar is included in Karaf?s framework feature.  

<feature version="${project.version}" description="Karaf core feature" name="framework" hidden="true">
        <!-- persistent wiring extension -->
        <bundle start-level="1">mvn:org.apache.karaf.features/org.apache.karaf.features.extension/${project.version}</bundle>
        <!-- mvn: and wrap: url handlers -->
        <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-aether/${pax.url.version}</bundle>
        <!-- logging -->
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-log4j2/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
        <!-- config admin -->
        <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle>
        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle>
        <!-- file install -->
        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/${felix.fileinstall.version}</bundle>
        <!-- features service -->
        <bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${servicemix-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${servicemix-spec.version}</bundle>
    </feature>

I can see that package javax.xml.parsers  is in  /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/lib/jrt-fs.jar,  so it is part of the Java 13 runtime.
Why can?t Karaf resolve it then?.  Does Karaf 4.2.8 works (has been tested) with Java 13?



On Feb 20, 2020, at 4:53 PM, Alex Soto <[hidden email]> wrote:

Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf?s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api;type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto


Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

Freeman-2
Hi Alex,

Thanks for the detailed feedback.
Would you please create a jira ticket so that we can have better track there.

Thanks!
Freeman



On Mon, Feb 24, 2020 at 12:02 PM Alex Soto <[hidden email]> wrote:
I tested with JDK 11 and it worked, but it does not work with JDK 13.
I hope I can migrate to 13 directly, since it it the current version. 

With JDK 13, here is the error:


$ bin/karaf
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.felix.framework.URLHandlers (file:/Users/asoto/Downloads/apache-karaf-4.2.8/system/org/apache/felix/org.apache.felix.framework/5.6.12/org.apache.felix.framework-5.6.12.jar) to constructor sun.net.www.protocol.file.Handler()
WARNING: Please consider reporting this to the maintainers of org.apache.felix.framework.URLHandlers
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Best regards,
Alex soto




On Feb 21, 2020, at 2:10 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

Let me check this out. I?m surprised. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 19:29, Alex Soto <[hidden email]> a ?crit :
It may be more than one problem,  JB, downloading a clean Karaf binary and running it on  Java 13 does not work out of the box.
Validating my application features.xml  does not work either,  karaf-maven-plugin fails to validate it for Java 13.

Best regards,
Alex soto




On Feb 21, 2020, at 12:55 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

On Jenkins we build and test using java 11. Let me fix for java 13. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 17:02, Alex Soto <[hidden email]> a ?crit :
I just confirmed a clean Karaf binary distribution downloaded from Karaf site, will not start with Java 13. 


Best regards,
Alex soto




On Feb 21, 2020, at 9:04 AM, Alex Soto <[hidden email]> wrote:

Inspecting pax-logging-api-1.11.4.jar manifest, shows: 


Import-Package: 
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.framework.wiring;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.apache.log;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,org.ops4j.pax.logging;version="[0.9.5,2.0.0)",
org.ops4j.pax.logging.avalon;version="[0.9.5,2.0.0)?


And pax-logging-api-1.11.4.jar is included in Karaf?s framework feature.  

<feature version="${project.version}" description="Karaf core feature" name="framework" hidden="true">
        <!-- persistent wiring extension -->
        <bundle start-level="1">mvn:org.apache.karaf.features/org.apache.karaf.features.extension/${project.version}</bundle>
        <!-- mvn: and wrap: url handlers -->
        <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-aether/${pax.url.version}</bundle>
        <!-- logging -->
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-log4j2/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
        <!-- config admin -->
        <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle>
        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle>
        <!-- file install -->
        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/${felix.fileinstall.version}</bundle>
        <!-- features service -->
        <bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${servicemix-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${servicemix-spec.version}</bundle>
    </feature>

I can see that package javax.xml.parsers  is in  /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/lib/jrt-fs.jar,  so it is part of the Java 13 runtime.
Why can?t Karaf resolve it then?.  Does Karaf 4.2.8 works (has been tested) with Java 13?



On Feb 20, 2020, at 4:53 PM, Alex Soto <[hidden email]> wrote:

Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf?s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api;type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto


Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

Alex Soto
Done:

https://issues.apache.org/jira/browse/KARAF-6624


Best regards,
Alex soto




On Feb 24, 2020, at 12:09 PM, Freeman Fang <[hidden email]> wrote:

Hi Alex,

Thanks for the detailed feedback.
Would you please create a jira ticket so that we can have better track there.

Thanks!
Freeman



On Mon, Feb 24, 2020 at 12:02 PM Alex Soto <[hidden email]> wrote:
I tested with JDK 11 and it worked, but it does not work with JDK 13.
I hope I can migrate to 13 directly, since it it the current version. 

With JDK 13, here is the error:


$ bin/karaf
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.felix.framework.URLHandlers (file:/Users/asoto/Downloads/apache-karaf-4.2.8/system/org/apache/felix/org.apache.felix.framework/5.6.12/org.apache.felix.framework-5.6.12.jar) to constructor sun.net.www.protocol.file.Handler()
WARNING: Please consider reporting this to the maintainers of org.apache.felix.framework.URLHandlers
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Best regards,
Alex soto




On Feb 21, 2020, at 2:10 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

Let me check this out. I?m surprised. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 19:29, Alex Soto <[hidden email]> a ?crit :
It may be more than one problem,  JB, downloading a clean Karaf binary and running it on  Java 13 does not work out of the box.
Validating my application features.xml  does not work either,  karaf-maven-plugin fails to validate it for Java 13.

Best regards,
Alex soto




On Feb 21, 2020, at 12:55 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

On Jenkins we build and test using java 11. Let me fix for java 13. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 17:02, Alex Soto <[hidden email]> a ?crit :
I just confirmed a clean Karaf binary distribution downloaded from Karaf site, will not start with Java 13. 


Best regards,
Alex soto




On Feb 21, 2020, at 9:04 AM, Alex Soto <[hidden email]> wrote:

Inspecting pax-logging-api-1.11.4.jar manifest, shows: 


Import-Package: 
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.framework.wiring;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.apache.log;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,org.ops4j.pax.logging;version="[0.9.5,2.0.0)",
org.ops4j.pax.logging.avalon;version="[0.9.5,2.0.0)?


And pax-logging-api-1.11.4.jar is included in Karaf?s framework feature.  

<feature version="${project.version}" description="Karaf core feature" name="framework" hidden="true">
        <!-- persistent wiring extension -->
        <bundle start-level="1">mvn:org.apache.karaf.features/org.apache.karaf.features.extension/${project.version}</bundle>
        <!-- mvn: and wrap: url handlers -->
        <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-aether/${pax.url.version}</bundle>
        <!-- logging -->
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-log4j2/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
        <!-- config admin -->
        <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle>
        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle>
        <!-- file install -->
        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/${felix.fileinstall.version}</bundle>
        <!-- features service -->
        <bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${servicemix-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${servicemix-spec.version}</bundle>
    </feature>

I can see that package javax.xml.parsers  is in  /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/lib/jrt-fs.jar,  so it is part of the Java 13 runtime.
Why can?t Karaf resolve it then?.  Does Karaf 4.2.8 works (has been tested) with Java 13?



On Feb 20, 2020, at 4:53 PM, Alex Soto <[hidden email]> wrote:

Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf?s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api;type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto



Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

jbonofre
In reply to this post by Alex Soto
Hi,

As said, it’s very easy to fix: just a missing —add-module.

I’m fixing it right now. Thanks for the Jira.

Regards
JB

Le 24 févr. 2020 à 18:02, Alex Soto <[hidden email]> a écrit :

I tested with JDK 11 and it worked, but it does not work with JDK 13.
I hope I can migrate to 13 directly, since it it the current version. 

With JDK 13, here is the error:


$ bin/karaf
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.felix.framework.URLHandlers (file:/Users/asoto/Downloads/apache-karaf-4.2.8/system/org/apache/felix/org.apache.felix.framework/5.6.12/org.apache.felix.framework-5.6.12.jar) to constructor sun.net.www.protocol.file.Handler()
WARNING: Please consider reporting this to the maintainers of org.apache.felix.framework.URLHandlers
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Best regards,
Alex soto




On Feb 21, 2020, at 2:10 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

Let me check this out. I?m surprised. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 19:29, Alex Soto <[hidden email]> a ?crit :
It may be more than one problem,  JB, downloading a clean Karaf binary and running it on  Java 13 does not work out of the box.
Validating my application features.xml  does not work either,  karaf-maven-plugin fails to validate it for Java 13.

Best regards,
Alex soto




On Feb 21, 2020, at 12:55 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

On Jenkins we build and test using java 11. Let me fix for java 13. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 17:02, Alex Soto <[hidden email]> a ?crit :
I just confirmed a clean Karaf binary distribution downloaded from Karaf site, will not start with Java 13. 


Best regards,
Alex soto




On Feb 21, 2020, at 9:04 AM, Alex Soto <[hidden email]> wrote:

Inspecting pax-logging-api-1.11.4.jar manifest, shows: 


Import-Package: 
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.framework.wiring;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.apache.log;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,org.ops4j.pax.logging;version="[0.9.5,2.0.0)",
org.ops4j.pax.logging.avalon;version="[0.9.5,2.0.0)?


And pax-logging-api-1.11.4.jar is included in Karaf?s framework feature.  

<feature version="${project.version}" description="Karaf core feature" name="framework" hidden="true">
        <!-- persistent wiring extension -->
        <bundle start-level="1">mvn:org.apache.karaf.features/org.apache.karaf.features.extension/${project.version}</bundle>
        <!-- mvn: and wrap: url handlers -->
        <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-aether/${pax.url.version}</bundle>
        <!-- logging -->
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-log4j2/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
        <!-- config admin -->
        <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle>
        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle>
        <!-- file install -->
        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/${felix.fileinstall.version}</bundle>
        <!-- features service -->
        <bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${servicemix-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${servicemix-spec.version}</bundle>
    </feature>

I can see that package javax.xml.parsers  is in  /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/lib/jrt-fs.jar,  so it is part of the Java 13 runtime.
Why can?t Karaf resolve it then?.  Does Karaf 4.2.8 works (has been tested) with Java 13?



On Feb 20, 2020, at 4:53 PM, Alex Soto <[hidden email]> wrote:

Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf?s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api;type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto



Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

Alex Soto
Hi JB,  

As a work-around, can you provide more detail about the fix?
Where do I need to add the `—ad-module` ?  


Best regards,
Alex soto




On Feb 24, 2020, at 12:37 PM, Jean-Baptiste Onofre <[hidden email]> wrote:

Hi,

As said, it’s very easy to fix: just a missing —add-module.

I’m fixing it right now. Thanks for the Jira.

Regards
JB

Le 24 févr. 2020 à 18:02, Alex Soto <[hidden email]> a écrit :

I tested with JDK 11 and it worked, but it does not work with JDK 13.
I hope I can migrate to 13 directly, since it it the current version. 

With JDK 13, here is the error:


$ bin/karaf
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.felix.framework.URLHandlers (file:/Users/asoto/Downloads/apache-karaf-4.2.8/system/org/apache/felix/org.apache.felix.framework/5.6.12/org.apache.felix.framework-5.6.12.jar) to constructor sun.net.www.protocol.file.Handler()
WARNING: Please consider reporting this to the maintainers of org.apache.felix.framework.URLHandlers
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Best regards,
Alex soto




On Feb 21, 2020, at 2:10 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

Let me check this out. I?m surprised. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 19:29, Alex Soto <[hidden email]> a ?crit :
It may be more than one problem,  JB, downloading a clean Karaf binary and running it on  Java 13 does not work out of the box.
Validating my application features.xml  does not work either,  karaf-maven-plugin fails to validate it for Java 13.

Best regards,
Alex soto




On Feb 21, 2020, at 12:55 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

On Jenkins we build and test using java 11. Let me fix for java 13. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 17:02, Alex Soto <[hidden email]> a ?crit :
I just confirmed a clean Karaf binary distribution downloaded from Karaf site, will not start with Java 13. 


Best regards,
Alex soto




On Feb 21, 2020, at 9:04 AM, Alex Soto <[hidden email]> wrote:

Inspecting pax-logging-api-1.11.4.jar manifest, shows: 


Import-Package: 
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.framework.wiring;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.apache.log;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,org.ops4j.pax.logging;version="[0.9.5,2.0.0)",
org.ops4j.pax.logging.avalon;version="[0.9.5,2.0.0)?


And pax-logging-api-1.11.4.jar is included in Karaf?s framework feature.  

<feature version="${project.version}" description="Karaf core feature" name="framework" hidden="true">
        <!-- persistent wiring extension -->
        <bundle start-level="1">mvn:org.apache.karaf.features/org.apache.karaf.features.extension/${project.version}</bundle>
        <!-- mvn: and wrap: url handlers -->
        <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-aether/${pax.url.version}</bundle>
        <!-- logging -->
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-log4j2/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
        <!-- config admin -->
        <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle>
        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle>
        <!-- file install -->
        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/${felix.fileinstall.version}</bundle>
        <!-- features service -->
        <bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${servicemix-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${servicemix-spec.version}</bundle>
    </feature>

I can see that package javax.xml.parsers  is in  /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/lib/jrt-fs.jar,  so it is part of the Java 13 runtime.
Why can?t Karaf resolve it then?.  Does Karaf 4.2.8 works (has been tested) with Java 13?



On Feb 20, 2020, at 4:53 PM, Alex Soto <[hidden email]> wrote:

Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf?s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api;type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto




Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

jbonofre
Hi Alex,

I gonna provide the workaround in the Jira and share there after (I’m working on the fix in the train ;) ).

Regards
JB

Le 24 févr. 2020 à 18:50, Alex Soto <[hidden email]> a écrit :

Hi JB,  

As a work-around, can you provide more detail about the fix?
Where do I need to add the `—ad-module` ?  


Best regards,
Alex soto




On Feb 24, 2020, at 12:37 PM, Jean-Baptiste Onofre <[hidden email]> wrote:

Hi,

As said, it’s very easy to fix: just a missing —add-module.

I’m fixing it right now. Thanks for the Jira.

Regards
JB

Le 24 févr. 2020 à 18:02, Alex Soto <[hidden email]> a écrit :

I tested with JDK 11 and it worked, but it does not work with JDK 13.
I hope I can migrate to 13 directly, since it it the current version. 

With JDK 13, here is the error:


$ bin/karaf
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.felix.framework.URLHandlers (file:/Users/asoto/Downloads/apache-karaf-4.2.8/system/org/apache/felix/org.apache.felix.framework/5.6.12/org.apache.felix.framework-5.6.12.jar) to constructor sun.net.www.protocol.file.Handler()
WARNING: Please consider reporting this to the maintainers of org.apache.felix.framework.URLHandlers
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Best regards,
Alex soto




On Feb 21, 2020, at 2:10 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

Let me check this out. I?m surprised. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 19:29, Alex Soto <[hidden email]> a ?crit :
It may be more than one problem,  JB, downloading a clean Karaf binary and running it on  Java 13 does not work out of the box.
Validating my application features.xml  does not work either,  karaf-maven-plugin fails to validate it for Java 13.

Best regards,
Alex soto




On Feb 21, 2020, at 12:55 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

On Jenkins we build and test using java 11. Let me fix for java 13. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 17:02, Alex Soto <[hidden email]> a ?crit :
I just confirmed a clean Karaf binary distribution downloaded from Karaf site, will not start with Java 13. 


Best regards,
Alex soto




On Feb 21, 2020, at 9:04 AM, Alex Soto <[hidden email]> wrote:

Inspecting pax-logging-api-1.11.4.jar manifest, shows: 


Import-Package: 
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.framework.wiring;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.apache.log;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,org.ops4j.pax.logging;version="[0.9.5,2.0.0)",
org.ops4j.pax.logging.avalon;version="[0.9.5,2.0.0)?


And pax-logging-api-1.11.4.jar is included in Karaf?s framework feature.  

<feature version="${project.version}" description="Karaf core feature" name="framework" hidden="true">
        <!-- persistent wiring extension -->
        <bundle start-level="1">mvn:org.apache.karaf.features/org.apache.karaf.features.extension/${project.version}</bundle>
        <!-- mvn: and wrap: url handlers -->
        <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-aether/${pax.url.version}</bundle>
        <!-- logging -->
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-log4j2/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
        <!-- config admin -->
        <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle>
        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle>
        <!-- file install -->
        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/${felix.fileinstall.version}</bundle>
        <!-- features service -->
        <bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${servicemix-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${servicemix-spec.version}</bundle>
    </feature>

I can see that package javax.xml.parsers  is in  /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/lib/jrt-fs.jar,  so it is part of the Java 13 runtime.
Why can?t Karaf resolve it then?.  Does Karaf 4.2.8 works (has been tested) with Java 13?



On Feb 20, 2020, at 4:53 PM, Alex Soto <[hidden email]> wrote:

Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf?s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api;type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto





Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

jbonofre
Hi Alex,

Actually, the —add-module that I was thinking is already there.

The problem is about the Felix framework (also equinox).

Karaf 4.3.0.RC1 just works fine with JDK 13 (as I upgraded Felix framework version). However, Karaf 4.2.x only supports up to JDK 11. 

I just tried with Karaf 4.3.0-SNAPSHOT, and it works fine with JDK 13.

So, no easy workaround on Karaf 4.2.x (changing Felix framework also means changing OSGi spec, which is not supported). So, if you really want to use JDK 13, you have to use Karaf 4.3.x.

Regards
JB

Le 24 févr. 2020 à 18:56, Jean-Baptiste Onofre <[hidden email]> a écrit :

Hi Alex,

I gonna provide the workaround in the Jira and share there after (I’m working on the fix in the train ;) ).

Regards
JB

Le 24 févr. 2020 à 18:50, Alex Soto <[hidden email]> a écrit :

Hi JB,  

As a work-around, can you provide more detail about the fix?
Where do I need to add the `—ad-module` ?  


Best regards,
Alex soto




On Feb 24, 2020, at 12:37 PM, Jean-Baptiste Onofre <[hidden email]> wrote:

Hi,

As said, it’s very easy to fix: just a missing —add-module.

I’m fixing it right now. Thanks for the Jira.

Regards
JB

Le 24 févr. 2020 à 18:02, Alex Soto <[hidden email]> a écrit :

I tested with JDK 11 and it worked, but it does not work with JDK 13.
I hope I can migrate to 13 directly, since it it the current version. 

With JDK 13, here is the error:


$ bin/karaf
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.felix.framework.URLHandlers (file:/Users/asoto/Downloads/apache-karaf-4.2.8/system/org/apache/felix/org.apache.felix.framework/5.6.12/org.apache.felix.framework-5.6.12.jar) to constructor sun.net.www.protocol.file.Handler()
WARNING: Please consider reporting this to the maintainers of org.apache.felix.framework.URLHandlers
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Best regards,
Alex soto




On Feb 21, 2020, at 2:10 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

Let me check this out. I?m surprised. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 19:29, Alex Soto <[hidden email]> a ?crit :
It may be more than one problem,  JB, downloading a clean Karaf binary and running it on  Java 13 does not work out of the box.
Validating my application features.xml  does not work either,  karaf-maven-plugin fails to validate it for Java 13.

Best regards,
Alex soto




On Feb 21, 2020, at 12:55 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

On Jenkins we build and test using java 11. Let me fix for java 13. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 17:02, Alex Soto <[hidden email]> a ?crit :
I just confirmed a clean Karaf binary distribution downloaded from Karaf site, will not start with Java 13. 


Best regards,
Alex soto




On Feb 21, 2020, at 9:04 AM, Alex Soto <[hidden email]> wrote:

Inspecting pax-logging-api-1.11.4.jar manifest, shows: 


Import-Package: 
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.framework.wiring;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.apache.log;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,org.ops4j.pax.logging;version="[0.9.5,2.0.0)",
org.ops4j.pax.logging.avalon;version="[0.9.5,2.0.0)?


And pax-logging-api-1.11.4.jar is included in Karaf?s framework feature.  

<feature version="${project.version}" description="Karaf core feature" name="framework" hidden="true">
        <!-- persistent wiring extension -->
        <bundle start-level="1">mvn:org.apache.karaf.features/org.apache.karaf.features.extension/${project.version}</bundle>
        <!-- mvn: and wrap: url handlers -->
        <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-aether/${pax.url.version}</bundle>
        <!-- logging -->
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-log4j2/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
        <!-- config admin -->
        <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle>
        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle>
        <!-- file install -->
        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/${felix.fileinstall.version}</bundle>
        <!-- features service -->
        <bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${servicemix-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${servicemix-spec.version}</bundle>
    </feature>

I can see that package javax.xml.parsers  is in  /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/lib/jrt-fs.jar,  so it is part of the Java 13 runtime.
Why can?t Karaf resolve it then?.  Does Karaf 4.2.8 works (has been tested) with Java 13?



On Feb 20, 2020, at 4:53 PM, Alex Soto <[hidden email]> wrote:

Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf?s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api;type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto






Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

Alex Soto
Thank you very much, JB.

Best regards,
Alex soto




On Feb 24, 2020, at 3:24 PM, Jean-Baptiste Onofre <[hidden email]> wrote:

Hi Alex,

Actually, the —add-module that I was thinking is already there.

The problem is about the Felix framework (also equinox).

Karaf 4.3.0.RC1 just works fine with JDK 13 (as I upgraded Felix framework version). However, Karaf 4.2.x only supports up to JDK 11. 

I just tried with Karaf 4.3.0-SNAPSHOT, and it works fine with JDK 13.

So, no easy workaround on Karaf 4.2.x (changing Felix framework also means changing OSGi spec, which is not supported). So, if you really want to use JDK 13, you have to use Karaf 4.3.x.

Regards
JB

Le 24 févr. 2020 à 18:56, Jean-Baptiste Onofre <[hidden email]> a écrit :

Hi Alex,

I gonna provide the workaround in the Jira and share there after (I’m working on the fix in the train ;) ).

Regards
JB

Le 24 févr. 2020 à 18:50, Alex Soto <[hidden email]> a écrit :

Hi JB,  

As a work-around, can you provide more detail about the fix?
Where do I need to add the `—ad-module` ?  


Best regards,
Alex soto




On Feb 24, 2020, at 12:37 PM, Jean-Baptiste Onofre <[hidden email]> wrote:

Hi,

As said, it’s very easy to fix: just a missing —add-module.

I’m fixing it right now. Thanks for the Jira.

Regards
JB

Le 24 févr. 2020 à 18:02, Alex Soto <[hidden email]> a écrit :

I tested with JDK 11 and it worked, but it does not work with JDK 13.
I hope I can migrate to 13 directly, since it it the current version. 

With JDK 13, here is the error:


$ bin/karaf
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.felix.framework.URLHandlers (file:/Users/asoto/Downloads/apache-karaf-4.2.8/system/org/apache/felix/org.apache.felix.framework/5.6.12/org.apache.felix.framework-5.6.12.jar) to constructor sun.net.www.protocol.file.Handler()
WARNING: Please consider reporting this to the maintainers of org.apache.felix.framework.URLHandlers
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Best regards,
Alex soto




On Feb 21, 2020, at 2:10 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

Let me check this out. I?m surprised. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 19:29, Alex Soto <[hidden email]> a ?crit :
It may be more than one problem,  JB, downloading a clean Karaf binary and running it on  Java 13 does not work out of the box.
Validating my application features.xml  does not work either,  karaf-maven-plugin fails to validate it for Java 13.

Best regards,
Alex soto




On Feb 21, 2020, at 12:55 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

On Jenkins we build and test using java 11. Let me fix for java 13. 

Regards 
JB

Le ven. 21 f?vr. 2020 ? 17:02, Alex Soto <[hidden email]> a ?crit :
I just confirmed a clean Karaf binary distribution downloaded from Karaf site, will not start with Java 13. 


Best regards,
Alex soto




On Feb 21, 2020, at 9:04 AM, Alex Soto <[hidden email]> wrote:

Inspecting pax-logging-api-1.11.4.jar manifest, shows: 


Import-Package: 
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.framework.wiring;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.apache.log;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,org.ops4j.pax.logging;version="[0.9.5,2.0.0)",
org.ops4j.pax.logging.avalon;version="[0.9.5,2.0.0)?


And pax-logging-api-1.11.4.jar is included in Karaf?s framework feature.  

<feature version="${project.version}" description="Karaf core feature" name="framework" hidden="true">
        <!-- persistent wiring extension -->
        <bundle start-level="1">mvn:org.apache.karaf.features/org.apache.karaf.features.extension/${project.version}</bundle>
        <!-- mvn: and wrap: url handlers -->
        <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-aether/${pax.url.version}</bundle>
        <!-- logging -->
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-api/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.ops4j.pax.logging/pax-logging-log4j2/${pax.logging.version}</bundle>
        <bundle start-level="8">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
        <!-- config admin -->
        <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle>
        <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle>
        <!-- file install -->
        <bundle start-level="11">mvn:org.apache.felix/org.apache.felix.fileinstall/${felix.fileinstall.version}</bundle>
        <!-- features service -->
        <bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${servicemix-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${servicemix-spec.version}</bundle>
    </feature>

I can see that package javax.xml.parsers  is in  /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/lib/jrt-fs.jar,  so it is part of the Java 13 runtime.
Why can?t Karaf resolve it then?.  Does Karaf 4.2.8 works (has been tested) with Java 13?



On Feb 20, 2020, at 4:53 PM, Alex Soto <[hidden email]> wrote:

Notice that the error I am getting while validating the Features XML is this:

Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api; type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?]]


And that, apparently, is required by  pax-logging-api (not my code)so I would think that the correct dependency (providing javax.xml.parsers) would be included in one of the Karaf?s features, or not?


Best regards,
Alex soto




On Feb 20, 2020, at 3:07 PM, Jean-Baptiste Onofr? <[hidden email]> wrote:

You have to provide jaxb bundle as it?s now module so not included in jdk (like ?add-module). 
So tour feature should reference jaxb dep. 

Regards 
JB

Le jeu. 20 f?vr. 2020 ? 16:58, Alex Soto <[hidden email]> a ?crit :
More info:

If I specify:
<javase>1.8</javase>

In the karaf-maven-plugin configuration, then I get error:

missing requirement [xxx] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=13))"

And, if I specify:

<javase>13</javase>      or
<javase>1.13</javase>

Then I get error:

missing requirement [xxx] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)?

Any hint will be appreciated.
Best regards,
Alex soto




On Feb 20, 2020, at 9:44 AM, Alex Soto <[hidden email]> wrote:

Anybody?s done migration of Karaf app to Java 13?  (I said 11 before, but it is actually 13)

Some of the errors I am getting from karaf-maven-plugin:4.2.8:verify:


[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=framework; type=karaf.feature; filter:="(&(osgi.identity=framework)(type=karaf.feature))" [caused by: Unable to resolve framework/4.2.8: missing requirement [framework/4.2.8] osgi.identity; osgi.identity=org.ops4j.pax.logging.pax-logging-api;type=osgi.bundle; version="[1.11.4,1.11.4]"; resolution:=mandatory [caused by: Unable to resolve org.ops4j.pax.logging.pax-logging-api/1.11.4: missing requirement [org.ops4j.pax.logging.pax-logging-api/1.11.4] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.parsers)"]]




Best regards,
Alex soto




On Feb 19, 2020, at 1:26 PM, Alex Soto <[hidden email]> wrote:

Hello,

I am migrating to Java 11 (from Java 8).  Everything builds successfully, but running Pax-Exam integration tests produces this error:


WARNING: package org.apache.karaf.specs.locator not in java.base
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.dto",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.framework",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.osgi.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.namespace;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.service.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.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.8",org.apache.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.8",org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding, sun.misc, com.sun.jmx.remote.protocol, com.sun.jmx.remote.protocol.jmxmp, org.apache.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.8, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
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)


I understand there is an empty package export (two consecutive commas in red color above),  but I don?t know where it is coming from. Any ideas?

Best regards,
Alex soto