|
From: Mika R. <mry...@ma...> - 2001-04-25 22:32:39
|
[Jayson S Baird] >Hiho, > > I'm a developer who is trying to embed Python code into Java, so of >course I came to Jython. When trying to run your example after compiling, >I get the following stack dump: > Exception in thread "main" java.lang.NullPointerException > at org.python.core.PyJavaClass.lookup(PyJavaClass.java:39) > at org.python.core.PyObject.<init>(PyObject.java:46) > at org.python.core.PySingleton.<init>(PySingleton.java:8) > at org.python.core.PyNone.<init>(PyNone.java:7) > at org.python.core.PySystemState.initStaticFields(PySystemState.java:341) > at org.python.core.PySystemState.initialize(PySystemState.java:320) > at org.python.core.PySystemState.initialize(PySystemState.java:294) > at org.python.core.PySystemState.initialize(PySystemState.java:287) > at org.python.util.PythonInterpreter.<init>(PythonInterpreter.java:61) > at org.python.util.PythonInterpreter.<init>(PythonInterpreter.java:45) > at SimpleEmbedded.main(SimpleEmbedded.java:6) > >Any idea what's causing this? no one has mentioned it in the FAQ's or the >list archives... Hello! The original post was rather old, but as there was no solutions I thought I'd suggest something. I've been using Jython for three days now, so if this is something obvious, please don't flame me :-) I encountered this problem today (exactly the same exception as above). I had installed full Jython (with sources). I was using "classpath=c:\windows\jython-2.1a1;.". I think this means that most Jython classes are loaded from dir "c:\windows\jython-2.1a1\org\python\core". For some reason there was no corresponding compiled .class files for "InternalTables1.java", "InternalTables2.java" and "exceptions.java" included in that directory. The problem was fixed either by compiling these three files, or changing classpath to use the ready-made jar: "classpath=c:\windows\jython-2.1a1\jython.jar;.". I hope this is helpful to someone! -- Mika |