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:55:00 GMT

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

Tommy Svensson commented on KARAF-5242:

I have also now discovered that whenever I build a new bundle jar and deploy it, this class
loading problem occurs. But if I kill karaf, and then start it again, everything loads as
it should it also runs as it should. So whenever I've updated a bundle I have to stop, start,
stop, start to get it working. 

The reason for stopping and starting to begin with is that this is running within vagrant,
and the bundles to deploy is shared with IDE under /vagrant/vagrant/deploy, which is a special
vagrant share filesystem that Karaf does not seem to be able to get information about new
deployments from. So when I build and install new versions of bundles Karaf will not detect
that and redeploy. But that is probably a vagrant problem rather than a Karaf problem. 

> 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