From: <bc...@wo...> - 2001-11-08 19:10:19
|
[John Goerzen] >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. The return value from PythonInterpreter.get() is always a PyObject instance. You need to explicit convert the returned PyObject instance to an instance of your java class like this: Object tmp = interp.get("cl").__tojava__(ListBO.class); if (tmp != Py.NoConversion) { ListBO newobj = (ListBO) tmp; } If the "cl" variable can't be converted to a ListBO, the constant value of Py.NoConversion is returned. regards, finn |