|
From: yoshizak <yos...@da...> - 2001-10-22 17:02:43
|
Hi Robert,
Haven't been able to reply for awhile because of other business stuff, in
anycase the situation changed a little though the result is largely the
same
(not working yet)
>I'm not sure this helps, but the code you list below works fine for me
>(linux+sunJDK1.3). One thing that might be worth checking is whether
>the tryJythonSample class actually exists in a file called
>"tryJythonSample.py". The matching classname/filename is required here,
>and a difference in those names makes a NPE like you are seeing.
>
>If that's no help, check back again :)
>
>-robert
Well, getting back to you here's the situation.
I'm now using Linux Mandrake 8.1
with sun's JDK1.3.1
and running jython 2.0
anyhow, I did the following,
jythonc tryJythonSample.py (same result with --all option)
(all code at end of email)
copied the compiled code from the jpywork directory into the current one
(cp jpywork/* .)
javac -classpath /<directory tree>/jython-2.0:. tryJythonMain.java
java tryJythonMain
Exception in thread "main" java.lang.NoClassDefFoundError:
org/python/core/PyProxy
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at tryJythonMain.main(tryJythonMain.java:10)
Any ideas what this is all about? There is obviously something that I'm
doing
very wrong since something this simple should work no?
Thanks in advance,
Hubert
btw, tried with
jythonc --package tryJythonPackage tryJythonSample.py
with the corresponding javac code and slight changes to the source code
(i.e.
import etc.) And I still get the same error message when I run it.
As for the reason to go to Linux from win2k, my machine (which was used by
someone else before) was not a clean machine. It had (cound them) three
jdk's
but a bunch of other junk that should not be there so in the interest of
killing as many portential problems as possible I switched to Linux (though
admitedly, Mandrake may not be the greatest for development).
===================================================================
code
tryJythonSample.py
import java
class tryJythonSample(java.lang.Object):
def __init__(self):
"@sig public tryJythonSample()"
print "Constructor for tryJythonSample"
def makeObject(self):
"@sig public void makeObject()"
print "I have just called a python method!!"
tryJythonMain.java
import org.python.core.*;
import tryJythonSample;
public class tryJythonMain
{
public static void main(String[] args)
{
tryJythonSample jySample = new tryJythonSample();
jySample.makeObject();
}
}
|