Message2394
Let's say that you've got some Jython classes whose
methods are exported via RMI. The remote client invokes
one of these methods, and a PyException is thrown.
The RMI system takes that exception, wraps it inside of
a java.rmi.RemoteException object, serializes the
resulting object, and sends it over the wire back to
the client.
The problem is that PyException can't be deserialized
by the vanilla ObjectInputStream that RMI uses...you
get wonderful UnmarshalExceptions due to the fact that
"java.lang.method objects aren't serializable" (I can
supply a full stack trace if necessary). And there's no
way I can tell to make RMI use PythonObjectInputStream
instead.
My fix has been to modify PyException.java so that when
a PyException is constructed, we do a toString() on it
and store the result in an instance variable. The other
PyObject instance variables (value, traceback, and
type) are marked transient. I then modified
printStackTrace() to print out this String
representation of the traceback if
Py.displayException() won't work.
Patch is against CVS tag Release_2_1.
Is there a better approach to fixing this problem?
Cheers,
Deepak Giridharagopal
deepak@arlut.utexas.edu |
|
Date |
User |
Action |
Args |
2008-02-20 17:18:25 | admin | link | issue1011738 messages |
2008-02-20 17:18:25 | admin | create | |
|