karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tommy Svensson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-5242) Classloading not compliant with java .class structure/content
Date Tue, 25 Jul 2017 12:46:02 GMT

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

Tommy Svensson commented on KARAF-5242:

Under "Environment" above I listed the output of "java -version". It is an OpenJDK so I guess
it is not from Oracle. It however have exactly the same version as the oracle JDK on my Mac.
I think there are licensing issues behind using Open JDK rather that the official Oracle linux
download. But I'm quite sure it is the same code since that would make sense.

> 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

View raw message