commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Sklyut <>
Subject RE: Re[2]: Jakarta Commons:Digester - Getting IllegalAccessExcept ion
Date Tue, 01 Jul 2003 14:57:01 GMT
Why would this be reported to SUN?  As far as I know this is a correct
behavior of the Java VM.

If the class is not public and you can only use it from the class in the
same package.  This is a regular scoping issue.


package my;

class MyExample {
	public void foo() {

package my.test;

public class Test {
	public static void main(String[] arg) {
		// my example is a package level class in the my package
		MyExample exmpl = new MyExample();;

This code will not compile because MyExample is not visible to the my.test
package Test class.

Reflection API gives you a set of tools to execute the methods of the
arbitrary classes dynamically during run time, but it is still govern by the
language specification restriction.

So if it is true during compile time, it should be true during runtime with
the reflection API.  There are ways to circumvent that, but those involve
permissions and security checking.

You best bet would be reading up on the java.lang.reflect package java doc,
and Reflection
API trail.  This should be enough to get you started.


-----Original Message-----
From: Anton Tagunov []
Sent: Tuesday, July 01, 2003 10:42 AM
To: Jakarta Commons Users List
Subject: Re[2]: Jakarta Commons:Digester - Getting

Hello Dmitry!

DS> There is an issue when invoking public methods contained in a default
DS> superclass. Reflection locates these methods fine and correctly assigns
DS> as public. However, an IllegalAccessException is thrown if the method is
DS> invoked.

Has this been reported to Sun?


To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message