[ https://issues.apache.org/jira/browse/KARAF-6345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17029366#comment-17029366 ]
Robert Varga edited comment on KARAF-6345 at 2/3/20 11:34 PM: -------------------------------------------------------------- Sorry this took so long, attached is a minimal reproducer (Java 11, just my mental default). Once built, repo-adding odl-karaf6345-0.1.0-SNAPSHOT-features.xml enables everything needed. Loading it into karaf-4.2.8, with a fresh install, this does not work: {code:java} karaf@root()> feature:install odl-karaf6345 {code} while doing the same through two steps does: {noformat} karaf@root()> feature:install odl-akka-persistence-2.5 karaf@root()> feature:install odl-karaf6345 {noformat} Examining karaf.log, the second feature:install is doing a bundle refresh which it should have resolved during the first feature:install: {noformat} 2020-02-04T00:33:46,600 | INFO | pipe-feature:install odl-karaf6345 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | Adding features: odl-karaf6345/[0.1.0.SNAPSHOT,0.1.0.SNAPSHOT] 2020-02-04T00:33:46,738 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | Changes to perform: 2020-02-04T00:33:46,739 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | Region: root 2020-02-04T00:33:46,739 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | Bundles to install: 2020-02-04T00:33:46,739 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | mvn:karaf6345/karaf6345/0.1.0-SNAPSHOT 2020-02-04T00:33:46,740 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | Stopping bundles: 2020-02-04T00:33:46,740 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | wrap_file__home_nite_.m2_repository_org_iq80_leveldb_leveldb_0.10_leveldb-0.10.jar/0.0.0 2020-02-04T00:33:46,741 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | com.typesafe.akka.persistence/2.5.26 2020-02-04T00:33:46,742 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | Installing bundles: 2020-02-04T00:33:46,742 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | mvn:karaf6345/karaf6345/0.1.0-SNAPSHOT 2020-02-04T00:33:46,744 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | Refreshing bundles: 2020-02-04T00:33:46,745 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | com.typesafe.akka.persistence/2.5.26 (Should be wired to: org.opendaylight.odlparent.leveldbjni- all/1.8.0 (through [com.typesafe.akka.persistence/2.5.26] osgi.wiring.package; resolution:=optional; filter:="(&(osgi.wiring.package=org.fusesource.leveldbjni)(version>=1.8.0)(!(version>=2.0.0)))")) 2020-02-04T00:33:46,745 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | wrap_file__home_nite_.m2_repository_org_iq80_leveldb_leveldb_0.10_leveldb-0.10.jar/0.0.0 (Should be wired to: org.opendaylight.odlparent.leveldbjni-all/1.8.0 (through [wrap_file__home_nite_.m2_repository_org_iq80_leveldb_leveldb_0.10_leveldb-0.10.jar/0.0.0] osgi.wiring.package; resolution:=optional; filter:="(osgi.wiring.package=or g.iq80.leveldb)")) 2020-02-04T00:33:46,759 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | Starting bundles: 2020-02-04T00:33:46,760 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | wrap_file__home_nite_.m2_repository_org_iq80_leveldb_leveldb_0.10_leveldb-0.10.jar/0.0.0 2020-02-04T00:33:46,760 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | com.typesafe.akka.persistence/2.5.26 2020-02-04T00:33:46,761 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.8 | karaf6345/0.1.0.SNAPSHOT {noformat} was (Author: nite): Sorry this took so long, attached is a minimal reproducer (Java 11, just my mental default). Once built, repo-adding odl-karaf6345-0.1.0-SNAPSHOT-features.xml enables everything needed. Loading it into karaf-4.2.8, with a fresh install, this does not work: {code:java} karaf@root()> feature:install odl-karaf6345 {code} while doing the same through two steps does: {noformat} karaf@root()> feature:install odl-akka-persistence-2.5 karaf@root()> feature:install odl-karaf6345 {noformat} Examining karaf.log, the second feature:install is doing a bundle refresh which it should have resolved during the first feature:install: {noformat} 2020-02-04T00:19:42,046 | INFO | pipe-feature:install odl-karaf6345 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | Adding features: odl-karaf6345/[0.1.0.SNAPSHOT,0.1.0.SNAPSHOT] 2020-02-04T00:19:42,182 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | Changes to perform: 2020-02-04T00:19:42,183 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | Region: root 2020-02-04T00:19:42,183 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | Bundles to install: 2020-02-04T00:19:42,183 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | mvn:karaf6345/karaf6345/0.1.0-SNAPSHOT 2020-02-04T00:19:42,184 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | Stopping bundles: 2020-02-04T00:19:42,184 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | wrap_file__home_nite_.m2_repository_org_iq80_leveldb_leveldb_0.10_leveldb-0.10.jar/0.0.0 2020-02-04T00:19:42,185 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | com.typesafe.akka.persistence/2.5.26 2020-02-04T00:19:42,187 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | Installing bundles: 2020-02-04T00:19:42,187 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | mvn:karaf6345/karaf6345/0.1.0-SNAPSHOT 2020-02-04T00:19:42,191 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | Refreshing bundles: 2020-02-04T00:19:42,192 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | com.typesafe.akka.persistence/2.5.26 (Should be wired to: org.opendaylight.odlparent.leveldbjni- all/1.8.0 (through [com.typesafe.akka.persistence/2.5.26] osgi.wiring.package; resolution:=optional; filter:="(&(osgi.wiring.package=org.fusesource.leveldbjni)(version>=1.8.0)(!(version>=2.0.0)))")) 2020-02-04T00:19:42,192 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | wrap_file__home_nite_.m2_repository_org_iq80_leveldb_leveldb_0.10_leveldb-0.10.jar/0.0.0 (Should be wired to: org.opendaylight.odlparent.leveldbjni-all/1.8.0 (through [wrap_file__home_nite_.m2_repository_org_iq80_leveldb_leveldb_0.10_leveldb-0.10.jar/0.0.0] osgi.wiring.package; resolution:=optional; filter:="(osgi.wiring.package=or g.iq80.leveldb)")) 2020-02-04T00:19:42,208 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | Starting bundles: 2020-02-04T00:19:42,209 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | wrap_file__home_nite_.m2_repository_org_iq80_leveldb_leveldb_0.10_leveldb-0.10.jar/0.0.0 2020-02-04T00:19:42,210 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | com.typesafe.akka.persistence/2.5.26 2020-02-04T00:19:42,210 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.5 | karaf6345/0.1.0.SNAPSHOT {noformat} > Optional imports do not propagate to OSGi framework > --------------------------------------------------- > > Key: KARAF-6345 > URL: https://issues.apache.org/jira/browse/KARAF-6345 > Project: Karaf > Issue Type: Bug > Components: karaf > Affects Versions: 4.2.6, 4.2.7 > Reporter: Robert Varga > Assignee: Jean-Baptiste Onofré > Priority: Critical > Fix For: 4.3.0, 4.2.9 > > Attachments: karaf6345.tgz > > > Based on > [https://lists.apache.org/thread.html/bf9e724cc9715b2a568bac7537a7be4a8df85867a2126bbd14e4e79d@%3Cdev.karaf.apache.org%3E] > The problem is that: > {noformat} > java.lang.NoClassDefFoundError: org/iq80/leveldb/DBFactory > at java.lang.Class.getDeclaredConstructors0(Native Method) > at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) > at java.lang.Class.getDeclaredConstructors(Class.java:2020) > at akka.util.Reflect$.findConstructor(Reflect.scala:92) > at > akka.persistence.Persistence.akka$persistence$Persistence$$createPlugin(Persistence.scala:408) > [snip] > Caused by: java.lang.ClassNotFoundException: org.iq80.leveldb.DBFactory > cannot be found by com.typesafe.akka.persistence_2.5.23 > at > org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484) > at > org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395) > at > org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387) > at > org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150) > at java.lang.ClassLoader.loadClass(ClassLoader.java:357) > ... 32 more{noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005)