Apache OpenOffice (AOO) Bugzilla – Issue 78308
IllegalArgumentException not Serializable
Last modified: 2017-05-20 11:31:11 UTC
The class: IllegalArgumentException (I couldn't find out which package) has a field named Context in which an object $Proxy0 is set. The Exception inherits from Throwable which implements the interface Serializable. The Proxy is not serializable. The defect can be seen by looking i.e. static analysis of the code. Serialisation leads the following Exception: java.io.NotSerializableException: com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075) Thanks for fixing this since this causes us quite a headache. Our application sends any exception encountered on the server to the client, so that debugging is simplified. Yours, Stefan
jsc -> sb: you volunteered to comment on this issue
Java serialization and UNO are at odds. In a sense, URP is UNO's replacement for Java serialization. Anyway, since some of the Java types representing UNO type system entities are (indirectly) serializable (e.g., all UNO exception types are represented by subtypes of java.lang.Throwable), something should be done about this. For all Java representations of UNO type system entities but for Java representations of non-null references to UNO objects (UNO interface types), adding serialization should be fairly straightforward. Remains the question how to serialize such non-null object references. (All UNO types can recursively be contained in UNO exception types, so even if we restricted ourselves to fixing just the exception serialization problem, we would end fixing the generalized serialization problem.) For a non-null UNO object reference of interface type T (where T should probably be the static type of the reference if it is a component of a sequence type or a member of a struct or exception type, and the dynamic type T' if it is the value <T',v> of an ANY), deserialization should probably produce a Java object that implements all the methods of T (plus com.sun.star.uno.IQueryInterface) and throws some specific java.lang.RuntimeException (like a DeserializedUnoObjectReferenceException) on every method invocation. (In general, it cannot work to serialize references to UNO objects and guarantee that they are still functional upon deserialization, so this is probably the closest possible general approximation.) @ronald15: If you need a quick solution, I would suggest you either use UNO to send exceptions from server to client, or send toString-representations of the exceptions.
set target to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
Reset assigne to the default "issues@openoffice.apache.org".