Message245

Author nobody
Recipients
Date 2001-01-03.17:30:59
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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
History
Date User Action Args
2008-02-20 17:16:47adminlinkissue227422 messages
2008-02-20 17:16:47admincreate