From: Peter B. <bri...@ma...> - 2001-08-08 22:38:15
|
Hi! I've got another problem with some code that works fine when interpreted with jython but breaks down when compiled with jythonc. I've narrowed the problem down to the following situation. We need two modules, say init.py and main.py. ---------------------------------------------------------------------- init.py: import java cl=java.lang.Object ---------------------------------------------------------------------- main.py import init class eggs(init.cl): pass print eggs() ---------------------------------------------------------------------- The idea is to derive a class from another class that's determined in a different module. The jython run gives the desired result: [brinkman@c1176023-a test]$ jython main.py <__main__.eggs instance at -1244487580> However, when I compile it with jythonc --core --jar test.jar main.py and run it with java -jar test.jar I get the following stack trace: > Java Traceback: > > at org.python.core.Py.JavaError(Py.java, Compiled Code) > at org.python.core.PyTableCode.call(PyTableCode.java, Compiled Code) > at org.python.core.imp.createFromCode(imp.java, Compiled Code) > at org.python.core.Py.runMain(Py.java, Compiled Code) > at main.main(main.java, Compiled Code) > Traceback (innermost last): > File "/home/brinkman/prog/java/gumbie/test/main.py", line 0, in main > java.lang.NoClassDefFoundError: org/python/compiler/ProxyMaker > at org.python.core.PyClass.init(PyClass.java, Compiled Code) > at org.python.core.Py.makeClass(Py.java, Compiled Code) > at org.python.core.Py.makeClass(Py.java, Compiled Code) > at main$_PyInner.main$2(main.java, Compiled Code) > at main$_PyInner.call_function(main.java, Compiled Code) > at org.python.core.PyTableCode.call(PyTableCode.java, Compiled Code) > at org.python.core.imp.createFromCode(imp.java, Compiled Code) > at org.python.core.Py.runMain(Py.java, Compiled Code) > at main.main(main.java, Compiled Code) > > java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/python/compiler/ProxyMaker > It appears that the problem only occurs when init.cl is a java class, such as java.lang.Object or java.awt.Frame or so. Python classes seem to work fine, both interpreted and compiled. I would appreciate any ideas regarding this problem. Thanks, Peter |