From: Kevin N. <ke...@na...> - 2003-11-10 00:36:47
|
>>I have this problem: >> >># A.py >> >>import B >> >>class A: >> b = B() >> >># B.py >> >>class B: >> pass >> >>When I try to compile (using the JythonCAntTask), I get this error: >> >> Creating .java files: >> File "c:\jython-2.1\Tools\jythonc\main.py", line 301, in main >> File "c:\jython-2.1\Tools\jythonc\main.py", line 221, in >>doCompile >> A module >> File "c:\jython-2.1\Tools\jythonc\compile.py", line 389, in >>dump >> File "c:\jython-2.1\Tools\jythonc\compile.py", line 325, in >> preprocessModule >> File "c:\jython-2.1\Tools\jythonc\compile.py", line 312, in >> makeJavaProxy >> File "c:\jython-2.1\Tools\jythonc\compile.py", line 58, in >>getsig >> File "c:\jython-2.1\Tools\jythonc\compile.py", line 84, in >> insistJavaClass >> ValueError: can not find class: B >> >>I've tried various compiler options, but I haven't been lucky enough to >>find a solution that works. > >funny because A.py+B.py will never produce that traceback, it's more likely >for something >like: > >import java > >class A(java.lang.Object): > > def meth(x): > "@sig public void meth(B x)" > pass > >regards. I'm sorry, I was too hasty with my example. I got off my lazy butt and actually compiled my example this time. You were right, and this is the correct problem: # A.py import B class A: def setB(self, b): """@sig public void setB(B b)""" self.b = b # B.py class B: pass Which produces this output: processing A processing B Required packages: Creating adapters: Creating .java files: A module Traceback (innermost last): File "c:\jython-2.1\Tools\jythonc\jythonc.py", line 5, in ? File "c:\jython-2.1\Tools\jythonc\main.py", line 301, in main File "c:\jython-2.1\Tools\jythonc\main.py", line 221, in doCompile File "c:\jython-2.1\Tools\jythonc\compile.py", line 389, in dump File "c:\jython-2.1\Tools\jythonc\compile.py", line 325, in preprocessModule File "c:\jython-2.1\Tools\jythonc\compile.py", line 312, in makeJavaProxy File "c:\jython-2.1\Tools\jythonc\compile.py", line 58, in getsig File "c:\jython-2.1\Tools\jythonc\compile.py", line 84, in insistJavaClass ValueError: can not find class: B Any clues? Thanks. -Kevin Nardi |