|
From: Charlie G. <cha...@gm...> - 2006-05-16 14:12:17
|
Hi,
I have some code like the following that attempts to set up a
PythonInterpreter with a special ClassLoader that has classes I'd like
to test on it
PySystemState.initialize( System.getProperties(), null,
new String[0], testClassLoader );
PythonInterpreter interp =3D new PythonInterpreter();
interp.exec( "import edu.sc.seis.flow.tester.ANDTesterTest" );
Running it yields the following exception
Traceback (innermost last):
(no code object) at line 0
Exception in thread "main" java.lang.NullPointerException
at org.python.core.Py.isInstance(Py.java:1817)
at org.python.core.__builtin__.isinstance(__builtin__.java:426)
at org.python.core.Py.displayException(Py.java:966)
at org.python.core.PyException.printStackTrace(PyException.java:100=
)
at org.apache.maven.surefire.util.NestedCheckedException.printStack=
Trace(NestedCheckedException.java:164)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBoo=
ter.java:760)
From what I can tell in Py.isInstance, the exception is Jython blowing
up because it isn't even set up enough to print out the real stack
trace. If I call PySystemState.initialize without testClassLoader, I
can execute code in the interpreter, but naturally I can't get to the
classes that I want on testClassLoader. The Jython classes are
available from testClassLoader, so I don't think that's the problem.
This is all on 2.2alpha1.
Is there something else I need to be doing?
Thanks,
Charlie Groves
|