[kaffe] unexpected java.lang.IllegalAccessError

Guilhem Lavaux guilhem at kaffe.org
Sun Sep 21 13:02:01 PDT 2003


Helmer Krämer wrote:

>On Sun, 21 Sep 2003 13:12:34 -0600 (MDT)
>Timothy Stack <stack at cs.utah.edu> wrote:
>
>  
>
>>>The attached program causes java.lang.IllegalAccessError
>>>when run with kaffe (ChangeLog head: 2003-09-13  Dalibor Topic
>>><robilad at kaffe.org>).
>>>
>>>When run with JDK
>>>      
>>>
>>Did you run it with '-verify' on?  I get something like:
>>
>>516 irontown:tmp8/katest> /usr/local/jdk1.3.1/bin/java -verify a.TestA
>>Exception in thread "main" java.lang.IllegalAccessError: try to access 
>>class b/TestBB from class a/TestA
>>        at a.TestA.main(TestA.java:8)
>>
>>    
>>
>>>or kaffe (ChangeLog head: 2003-08-27  Jim Pick
>>><jim at kaffe.org>), no such error occus.
>>>      
>>>
>>[test case cut...]
>>
>>Okie, I've had a look and I think its a problem with kjc and not the VM.  
>>In particular the code generated by kjc for the call to foo() is wrong (i 
>>think):
>>
>>  invokevirtual b/TestBB/foo()I
>>
>>Notice that its making the call on TestBB (package-private class) and not
>>TestB (public class).  Code generated by jikes/javac generates the correct 
>>call to TestB/foo().
>>    
>>
>
>Speaking about kjc - is the project still alive?
>I mean at the moment it looks like more and more
>people start using kaffe and we're thus running
>into several bugs in kjc that can be triggered by
>pretty usual java programs (could've been spotted
>earlier). 
>
>As for the runtime checking stuff: there seems to
>be another bug related to inner classes:
>
>hkraemer at moose:/tmp/access-test$ cat a/test.java 
>package a;
>public class test
>{
>	protected static class inner
>	{
>		public inner (){}
>	}
>}
>hkraemer at moose:/tmp/access-test$ cat b/test1.java 
>package b;
>import a.test;
>public class test1 extends test
>{
>	public void bar ()
>	{
>		new inner ();
>	}
>
>	public static void main (String[] args)
>	{
>		new test1().bar();
>	}
>}
>
>Looks like access to members of inherited inner
>classes is denied (test case was compiled with
>jikes 1.18).
>  
>
I might have a look at that one tomorrow evening. As I've already dealt 
with that problem of permission it should be pretty quick...

Cheers,
Guilhem.





More information about the kaffe mailing list