From: justin w. <ju...@bi...> - 2003-06-18 20:00:00
|
Hi, I had jython working all fine on OS X, and now I've messed it up. I. It's quite simple - I create a class in java and try to load it in jython. Jython can see the class all right, but fails when I try and instantiate it. As I said, it was working before but then I changed some system settings, specifically the environment variables (PATH, PYTHONPATH) that the Terminal application gets initialised with. I've tried changing the settings back, tried uninstalling / reinstalling Jython, but no luck. I've been using Jython for 2 years on all platforms and haven't seen anything like this before. Thanks for any help << java class >> package test; public class FooBar{ public void speak(){ System.out.println("here i am!"); } } << jython script >> [justin-worralls-Computer:~/java/fbl/2.99] justinworrall% jython Jython 2.1 on java1.3.1 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> from test import * >>> dir() ['FooBar', '__doc__', '__name__'] >>> x=FooBar() Traceback (innermost last): File "<console>", line 1, in ? java.lang.NullPointerException at java.lang.Class.isAssignableFrom(Native Method) at org.python.core.PyJavaClass.init__class__(PyJavaClass.java) at org.python.core.PyJavaClass.init(PyJavaClass.java) at org.python.core.PyJavaClass.initLazy(PyJavaClass.java) at org.python.core.PyJavaClass.initialize(PyJavaClass.java) at org.python.core.PyJavaClass.initConstructors(PyJavaClass.java) at org.python.core.PyJavaClass.__call__(PyJavaClass.java) at org.python.core.PyObject.__call__(PyObject.java) at org.python.pycode._pyx3.f$0(<console>:1) at org.python.pycode._pyx3.call_function(<console>) 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.Py.exec(Py.java) at org.python.util.PythonInterpreter.exec(PythonInterpreter.java) at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.ja va) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter. java) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter. java) at org.python.util.InteractiveConsole.push(InteractiveConsole.java) at org.python.util.InteractiveConsole.interact(InteractiveConsole.java) at org.python.util.jython.main(jython.java) java.lang.NullPointerException: java.lang.NullPointerException >>> |