From: <da...@cr...> - 2002-10-18 11:00:30
|
Hi, I'm having some odd behaviour with jython this week, after many happy months of trouble-free use. (jython 2.1, jdk1.4.0, redhat 6.2, nothing updated in several months). I declare a class with a few public constructors in java: package daves.employer; public class MyClass{ public MyClass(String s) throws Exception{ ... } public MyClass() throws Exception{ ... } ... } compile it and then run a jython script: import daves obj=daves.employer.MyClass("hello") ... and I get this stack trace: Traceback (innermost last): File "pop3test.py", line 11, in ? java.lang.IllegalAccessException: Class org.python.core.PyReflectedConstructor can not access a member of class daves.employer.MyClass with modifiers "public" at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:57) at java.lang.reflect.Constructor.newInstance(Constructor.java:268) at org.python.core.PyReflectedConstructor.__call__(PyReflectedConstructor.java) at org.python.core.PyJavaInstance.__init__(PyJavaInstance.java) at org.python.core.PyJavaClass.__call__(PyJavaClass.java) at org.python.core.PyObject.__call__(PyObject.java) at org.python.core.PyObject.invoke(PyObject.java) at org.python.pycode._pyx0.f$0(pop3test.py:11) at org.python.pycode._pyx0.call_function(pop3test.py) at org.python.core.PyTableCode.call(PyTableCode.java) at org.python.core.PyCode.call(PyCode.java) at org.python.core.Py.runCode(Py.java) at org.python.core.__builtin__.execfile_flags(__builtin__.java) at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java) at org.python.util.jython.main(jython.java) java.lang.IllegalAccessException: java.lang.IllegalAccessException: Class org.python.core.PyReflectedConstructor can not access a member of class daves.employer.MyClass with modifiers "public" I've rebuilt my entire codebase from scratch (ant clean followed by ant build, with the standard sort of ant build file), I've cleared out the jython class cache completely (but this just seems to process jars? My class is on the classpath in a directory rather than a jar). I've even changed the name of the class and deleted all copies of the old one, so I'm sure I'm not caching a stale copy anywhere. Why is it doing this? Any ideas? Thanks, Dave |