From: <no...@so...> - 2001-01-12 12:05:12
|
Bug #127422, was updated on 2001-Jan-03 09:30 Here is a current snapshot of the bug. Project: Jython Category: Core Status: Closed Resolution: Later Bug Group: None Priority: 2 Submitted by: nobody Assigned to : nobody Summary: Importing java-classes from non-defaul ClassLoaders Details: 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 an...@ib... Follow-Ups: Date: 2001-Jan-12 04:05 By: bckfnn Comment: This feature request is described in a new task (#24502) : "Loading java classes from other sources" The bug report will be closed. ------------------------------------------------------- Date: 2001-Jan-03 12:05 By: pedronis Comment: more a feature request than a bug. (sorry) notes: * simply making java loading through 'import' thread-context-class-loader related: a bad confusing hack, won't do that * simply setting PySystemState.classLoader at init: not really a workaround, by now too many jythonc-related side-effects, e.g. sys.path loading disabled ... This is part of the poor-man-freezing design issue (after 2.0): with jython -jar ... or java -jar ... what kind of: python importing java loading sys-package-manager init to offer? ... ------------------------------------------------------- For detailed info, follow this link: http://sourceforge.net/bugs/?func=detailbug&bug_id=127422&group_id=12867 |