Robert Varga created KARAF-7431:
-----------------------------------
Summary: Missing package exports for java.net.http and others
Key: KARAF-7431
URL: https://issues.apache.org/jira/browse/KARAF-7431
Project: Karaf
Issue Type: Bug
Components: karaf
Affects Versions: 4.3.7, 4.4.0
Reporter: Robert Varga
maven-bundle-plugin-5.1.5 has adopted bnd-6.2.0, which means the following is
in effect by default (
[https://github.com/bndtools/bnd/wiki/Changes-in-5.2.0#bnd=] ):
{noformat}
Bnd will now import java.* packages if the bundle either requires Java 11, or
later, or imports the org.osgi.framework package at a version >= 1.9. The
importing of java.* packages can be disabled with the instruction
-noimportjava: true.{noformat}
This also cross-references [OSGi
R7|https://docs.osgi.org/specification/osgi.core/7.0.0/framework.module.html#framework.module-execution.environment].
Attempting to use JDK11-specific features with the updated plugin and
Karaf-4.3.7 ends up with:
{noformat}
[ERROR]
SingleFeatureTest.installFeatureCatchAndLog(org.opendaylight.odlparent.featuretest.SingleFeatureTest)[repoUrl:
file:/home/nite/odl/infrautils/features/odl-infrautils-diagstatus/target/feature/feature.xml,
Feature: odl-infrautils-diagstatus 3.0.1.SNAPSHOT] Time elapsed: 8.53 s <<<
ERROR!
org.apache.felix.resolver.reason.ReasonException: Unable to resolve
org.opendaylight.infrautils.diagstatus-shell/3.0.1.SNAPSHOT: missing
requirement [org.opendaylight.infrautils.diagstatus-shell/3.0.1.SNAPSHOT]
osgi.wiring.package; filter:="(osgi.wiring.package=java.net.http)"
at
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
at
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
at
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
at
org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433)
at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
at
org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
at
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
{noformat}
This indicates that Karaf's jre.properties are incomplete at least for Java 11+.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)