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] [Comment Edited] (KARAF-5242) Classloading not compliant with java .class structure/content
Date Tue, 11 Jul 2017 15:28:00 GMT

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

Tommy Svensson edited comment on KARAF-5242 at 7/11/17 3:27 PM:
----------------------------------------------------------------

Strangely, on my MacBookPro: 

{{Darwin Tommys-MBP4 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64
x86_64}} 

and jdk:

{{java version "1.8.0_131"}}
{{Java(TM) SE Runtime Environment (build 1.8.0_131-b11)}}
{{Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)}}

this does not happen!  

Could possibly be a bug in the open jdk used on Linux, but if the jdk does not know how to
lookup inner classes it should have failed much earlier. A bug in a Karaf/Felix class loader
triggered by some special circumstance is more likely IMHO.



was (Author: tombensve):
Strangely, on my MacBookPro: 

{{Darwin Tommys-MBP4 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64
x86_64}} 

and jdk:

{{java version "1.8.0_131"}}
{{Java(TM) SE Runtime Environment (build 1.8.0_131-b11)}}
{{Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)}}

this does not happen!  Same Karaf version, same JDK version. 

> 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:
> {{
> 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
> }}
> 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:
> {{
> 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);
>                 }
> ...
> }}
> 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)

Mime
View raw message