[ 
https://issues.apache.org/jira/browse/KARAF-6345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16872585#comment-16872585
 ] 

Robert Varga commented on KARAF-6345:
-------------------------------------

IRC conversation:
{noformat}
[25/06/2019 19:42:24] <rovarga_> jbonofre: the erroring case is that we are 
passing a Class around and it fails to do getDeclaredConstructors()
[25/06/2019 19:44:35] <rovarga_> i.e. java.lang.Class.getDeclaredConstructors() 
fails because it ends up doing
[25/06/2019 19:44:47] <rovarga_> 
org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
[25/06/2019 19:45:08] <rovarga_> which is failing with:
[25/06/2019 19:45:13] <rovarga_> Caused by: java.lang.ClassNotFoundException: 
org.iq80.leveldb.DBFactory cannot be found by 
com.typesafe.akka.persistence_2.5.23
[25/06/2019 19:45:13] <rovarga_>         at 
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484)
[25/06/2019 19:46:41] <rovarga_> since DBFactory is observable (as implied by 
DBFactory.class), the optional import has been resolved in one the bundles
[25/06/2019 19:47:11] <rovarga_> hence it's something feature:install is doing 
wrong
[25/06/2019 19:47:30] <rovarga_> and it feels like something between felix 
resolver and equinox
[25/06/2019 19:48:44] <rovarga_> also karaf CLIs (imports, exports, headers) 
think everything is hunky-dory
[25/06/2019 19:50:49] <jbonofre> rovarga_: I'm skeptical
[25/06/2019 19:51:09] <jbonofre> rovarga_: honestly, I doubt, maybe a race 
condition
[25/06/2019 19:51:27] <jbonofre> rovarga_: like a missing refresh
[25/06/2019 19:52:48] <rovarga_> or an algorithmic thing like do { } while 
(TOCTOU race)
[25/06/2019 19:53:38] <jbonofre> rovarga_: do you have a rough idea how to 
reproduce it ?
[25/06/2019 19:53:47] <jbonofre> rovarga_: I will take a look in opendaylight 
directly
[25/06/2019 19:54:04] <rovarga_> jbonofre: I am just thinking how I can 
reproduce it with plain karaf and repo-add
[25/06/2019 19:54:28] <rovarga_> jbonofre: the distro I pointed to has 
everything needed
[25/06/2019 19:55:03] <rovarga_> and it's just the odl-leveldb and 
odl-akka-persistence features, you can disregards the rest
[25/06/2019 19:55:39] <rovarga_> it's just that the entire rest of the stack 
ends up deploying a .config file which causes the class being loaded
[25/06/2019 19:55:39] <jbonofre> rovarga_: ok
[25/06/2019 19:55:39] <jbonofre> rovarga_: ok
[25/06/2019 19:55:55] <jbonofre> rovarga_: I'm completing a blog post, I will 
switch on this one just after
[25/06/2019 19:56:05] <rovarga_> jbonofre: awesome, thanks
[25/06/2019 19:57:22] <rovarga_> the test case is: 'feature:install 
odl-leveldb' and 'feature:install odl-akka-persistence' -- the second one must 
not cause a refresh{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
>            Reporter: Robert Varga
>            Priority: Critical
>
> 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
(v7.6.3#76005)

Reply via email to