|
From: Hubert Y. <yos...@da...> - 2001-10-17 16:23:37
|
<html>
Hi Robert,<br>
Thanks for the advice, <br>
<br>
>There is a class naming problem.=A0 The class statement defines<br>
>"tryJythonSample", but the initializer tries to initialize
the<br>
>class "tryJython" in its @sig string.<br>
<br>
ahaha, don't know how I was blind/dumb enough to miss something as simple
as that. Must have been half-asleep when I miss-typed that. Oh well.
:P<br>
<br>
>> import tryJythonSample.*;<br>
><br>
>This import might be a problem.=A0 Unless you used the jythonc
--package<br>
>(-p) option to specify the tryJythonSample package, you should just
use<br>
>the following import:<br>
><br>
>import tryJythonSample<br>
<br>
still having problems...<br>
<br>
tried the 'import tryJythonSample' (without using the jythonc
--package option)<br>
<br>
<font color=3D"#0000FF"><i>Exception in thread "main"
java.lang.NullPointerException<br>
at
org.python.core.PyJavaClass.lookup(PyJavaClass.java:39)<br>
at
org.python.core.PyObject.<init>(PyObject.java:46)<br>
at
org.python.core.PySingleton.<init>(PySingleton.java:8)<br>
at
org.python.core.PyNone.<init>(PyNone.java:7)<br>
at
org.python.core.PySystemState.initStaticFields(PySystemState.java:341<br>
)<br>
at
org.python.core.PySystemState.initialize(PySystemState.java:320)<br>
at
org.python.core.Py.initProperties(Py.java:665)<br>
at
org.python.core.Py.initProxy(Py.java:709)<br>
at
tryJythonSample.<init>(tryJythonSample.java:105)<br>
at
tryJythonMain.main(tryJythonMain.java:8)<br>
<br>
</font></i><font color=3D"#000000">tried the 'import tryJythonSample.* when
using the jythonc --package option.<br>
got the error<br>
<br>
</font><font color=3D"#0000FF"><i>C:\Hubert\Work\Projects\tryJython\tryJytho=
nProject>java
tryJythonMain<br>
Exception in thread "main" java.lang.NullPointerException<br>
at
org.python.core.PyJavaClass.lookup(PyJavaClass.java:39)<br>
at
org.python.core.PyObject.<init>(PyObject.java:46)<br>
at
org.python.core.PySingleton.<init>(PySingleton.java:8)<br>
at
org.python.core.PyNone.<init>(PyNone.java:7)<br>
at
org.python.core.PySystemState.initStaticFields(PySystemState.java:341<br>
)<br>
at
org.python.core.PySystemState.initialize(PySystemState.java:320)<br>
at
org.python.core.Py.initProperties(Py.java:665)<br>
at
org.python.core.Py.initProxy(Py.java:709)<br>
at
tryJythonSample.tryJythonSample.<init>(tryJythonSample.java:107)<br>
at
tryJythonMain.main(tryJythonMain.java:8)<br>
<br>
<br>
</font></i><font color=3D"#000000">error wise, unless I'm mistaken, it
seems to be running into the same problem each time <br>
Any ideas?<br>
<br>
Hubert<br>
<br>
<br>
(for others, here's the code...)<br>
<br>
import org.python.core.*;<br>
import tryJythonSample;<br>
<br>
public class tryJythonMain<br>
{<br>
public static void main(String[] args)<br>
{<br>
tryJythonSample jySample =3D new tryJythonSample();<br>
jySample.makeObject();<br>
=20
&nbs=
p; &n=
bsp; =
&nbs=
p; &n=
bsp;
<br>
}<br>
}<br>
<br>
import java<br>
class tryJythonSample(java.lang.Object):<br>
def __init__(self):<br>
"@sig public tryJythonSample()"<br>
print
"Constructor for tryJythonSample"<br>
def makeObject(self):<br>
"@sig public void makeObject()"<br>
print
"I have just called a python method!!"<br>
<br>
<br>
<br>
</font>
<BR>
</html>
|