Message140

Author bckfnn
Recipients
Date 2000-11-18.19:31:07
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
For some reason, JPython cannot access a public method that is defined
in the package private base class of my object instance.  public Foo 
extends (package private) Bar.  Bar defines public String hi().  If I 
instantiate Foo and call hi() on the instance, I get an IllegalAccessException.

Java classes:
--------------------------------------------------------------
package testpackage;

public class Foo extends Bar {
}

class Bar {
    public String hi() {
        return "hi";
    }
}
---------------------------------------------------------------

Python code:
---------------------------------------------------------------
>>> from testpackage import Foo
>>> f = Foo()
>>> f.hi()
---------------------------------------------------------------

Resulting exception:
---------------------------------------------------------------
Traceback (innermost last):
  File "<console>", line 1, in ?
java.lang.IllegalAccessException: testpackage/Bar
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:158)
	at org.python.core.PyMethod.__call__(PyMethod.java:66)
	at org.python.core.PyObject.__call__(PyObject.java:260)
	at org.python.core.PyInstance.invoke(PyInstance.java:254)
	at org.python.pycode._pyx5.f$0(<console>)
	at org.python.pycode._pyx5.call_function(<console>)
	at org.python.core.PyTableCode.call(PyTableCode.java:155)
	at org.python.core.Py.runCode(Py.java:937)
	at org.python.core.Py.exec(Py.java:951)
	at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:121)
	at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:82)
	at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:63)
	at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:42)
	at org.python.util.InteractiveConsole.push(InteractiveConsole.java:84)
	at org.python.util.InteractiveConsole.interact(InteractiveConsole.java:63)
	at org.python.util.jpython.main(jpython.java:141)

java.lang.IllegalAccessException: java.lang.IllegalAccessException:
testpackage/Bar
History
Date User Action Args
2008-02-20 17:16:42adminlinkissue222847 messages
2008-02-20 17:16:42admincreate