[ https://issues.apache.org/jira/browse/KARAF-5242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16101234#comment-16101234 ]
Guillaume Nodet commented on KARAF-5242: ---------------------------------------- The message indicates that the bundle's wiring is no longer valid, which means that the bundle has been refreshed. In such cases, classes loaded with the previous wiring won't be able to load new classes. Your bundle is doing something wrong, as when the bundle is unresolved, there should be no references anymore to any of its classes. You may have a dangling thread or soemthing like that... > Classloading not compliant with java .class structure/content > ------------------------------------------------------------- > > Key: KARAF-5242 > URL: https://issues.apache.org/jira/browse/KARAF-5242 > Project: Karaf > Issue Type: Bug > Affects Versions: 4.1.1 > Environment: Linux run in Vagrant (ubuntu-16.04) > openjdk version "1.8.0_131" > OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.04.2-b11) > OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode) > Reporter: Tommy Svensson > > I get the following stack trace in the log: > {code} > Caused by: java.lang.ClassNotFoundException: Unable to load class > 'se.natusoft.osgi.aps.web.adminweb.WebContentServer$_closure1$_closure5' > because the bundle wiring for aps-admin-web-a2 is no longer valid. > at > org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1515) > ~[?:?] > at > org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:79) > ~[?:?] > at > org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1958) > ~[?:?] > at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:?] > ... 44 more > {code} > Note that '_closure1' is an inner class and that '_closure5' is in inner > class of '_closure_1'. > Bytecode wise they both reside in WebContentServer.class, and there is no > such thing as > "se.natusoft.osgi.aps.web.adminweb.WebContentServer$_closure1.class" nor > "se.natusoft.osgi.aps.web.adminweb.WebContentServer$_closure1$_closure5.class"! > > From decompiled WebContentServer.class: > {code} > public class WebContentServer extends VertxConsumer implements > Consumer<Vertx>, Constants { > ... > public class _closure1 extends Closure implements GeneratedClosure { > public _closure1(Object _thisObject) { > super(WebContentServer.this, _thisObject); > } > public Object doCall(Consumed<Router> router) { > > WebContentServer.pfaccess$01((WebContentServer)this.getThisObject(), router); > class _closure5 extends Closure implements GeneratedClosure { > public _closure5(Object _thisObject) { > super(_closure1.this, _thisObject); > } > ... > {code} > This is compiled from Groovy code which is still compatible with java5 byte > code standard. I have not read anywhere that java8 is not capable of running > java5 byte code, and when the code is run in unit tests with java8 there is > no problem. So I conclude that this problem resides in Karaf or more probably > Felix which is at the bottom as I understand it. It is with Karaf I have the > problem so it is here I report this. -- This message was sent by Atlassian JIRA (v6.4.14#64029)