harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Varlamov" <alexey.v.varla...@gmail.com>
Subject Re: [drlvm] invoking non-trivial jars results in IllegalAccessError
Date Mon, 25 Sep 2006 03:18:24 GMT
This is simple now :) - it's a pity a did not look at JarRunner earlier.

The launcher adds -Djava.class.path=<jar>, so the system classloader
become aware of that path. Due to delegation model, the system
classloader has precedence over MyLoader. The root cause of problem is
incorrect usage of API for MyLoader - JarRunner should call public
loadClass(String) instead of protected findClass(String) for MyLoader.
And the access modifiers hint this ;)

Actually I see no reason to deal with MyLoader at all - system
classloader would do fine.

--
Alexey


2006/9/25, Geir Magnusson Jr. <geir@pobox.com>:
>
> On Sep 24, 2006, at 8:09 PM, Gregory Shimansky wrote:
>
> > On Sunday 24 September 2006 05:46 Geir Magnusson Jr. wrote:
> >> On Sep 23, 2006, at 7:46 PM, Ivan Volosyuk wrote:
> >>> Actually... This is another bug :)
> >>
> >> Oh well :)
> >
> > I think I've found the cause of this bug. Now what to do with it...
>
> Thanks for looking into it so fast.
>
> >
> > 1. Class Foo is loaded by org/apache/harmony/vm/JarRunner$MyLoader
> > while Bar
> > is loaded by java/net/URLClassLoader$SubURLClassLoader.
>
> Why?  I thought they would be in the same classloader, given the fact
> that I fed the jar to MyLoader...
>
> >
> > 2. The comparison in Resolve.cpp:177 fails because each class
> > loader in VM has
> > its own table of packages and thus Foo and Bar while having the
> > same packages
> > in name, have different packages in terms of class loading. This
> > results in
> > IllegalAccessError.
> >
> > I am not sure what actually is wrong, #1 or #2 or both. I think all
> > user
> > application classes should be loaded by the same system class
> > loader unless
> > user specifies another one. So #1 seems to be the candidate for me.
> >
> > --
> > Gregory Shimansky, Intel Middleware Products Division
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message