From: John G. <jgo...@co...> - 2001-11-07 20:51:28
|
And as an additional data point: If I request an object of type java.lang.Object from get(), get() works. What's more, newobj.getClass().getSuperclass().getName() returns quovix.business.util.ListBO! However, casting newobj from Object to ListBO fails with a java.lang.ClassCastException on ListBOFoo$ListBOFoo$0! I'm rather mystified now. John Goerzen <jgo...@co...> writes: > Hi, > > I am accessing some python code from Java. When I try to use > interp.get() (where inter is a PythonInterpreter object), I get an > error saying it can't convert my object to the appropriate Java one. > > However! > > My object is a python subclass of the Java object I want it to be. > > IE, in Java I'm saying: > > ListBO newobj = (ListBO) interp.get("cl", this.getClass()); > > ("this" is a ListBO instance) > > In Python, cl is a variable that holds an instance of a ListBOFoo > class, which is defined: > > class ListBOFoo(quovix.business.util.ListBO): > ... > > The code seems to work (quovix is imported properly, etc). It's just > that calling "get" on it returns the conversion problem. > > I'm not sure where to go to fix this. Ideas? > > -- John > > -- > John Goerzen <jgo...@co...> GPG: 0x8A1D9A1F www.complete.org > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users -- John Goerzen <jgo...@co...> GPG: 0x8A1D9A1F www.complete.org |