Message245
I have my own classloader, which loads Jython also.
When I run this
+++++++
package a.b.c
import org.python.util.PythonInterpreter;
import org.python.core.*;
public class Test{
public static void main(String args[]) throws Exception {
PythonInterpreter interp = new PythonInterpreter();
interp.exec("from a.b.c import Test");
interp.exec("s = Test.countLetters('wednesday')");
PyObject x = interp.get("s");
System.out.println("s=" + x);
}
public static String countLetters(String str){
return "Word '"+str+"' has "+ str.length() + " letters";
}
}
++++++++++++++++
I have
"ImportError: no module named a"
But when I explicitly write my.jar(a.b.c.Test) to classpath - everithing is Ok.
What about usin' Thead.getContextClassLoader() in Py.findClass() or something?
PS can't register so my e-mail is andrew@ibis.odessa.ua |
|
Date |
User |
Action |
Args |
2008-02-20 17:16:47 | admin | link | issue227422 messages |
2008-02-20 17:16:47 | admin | create | |
|