[kaffe] BugReport: in RMI
Jeremy Buisson
jbuisson@irisa.fr
Wed Jul 23 15:17:12 2003
This is a multi-part message in MIME format.
--------------000105080503020803030103
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Hi!
I found what I think to be a bug in the Kaffe implementation of RMI.
This applies at least to kaffe 1.1.0 and CVS of 2003-07-21.
Return values of remote invocations are systematically serialized. This
does not conform to Sun's specifications: objects that are remote should
be replaced by the stub. This have been made for parameters, but not for
return values.
In order to fix this, the Unicast.Server class can be modified, and
especially its incomingMessageCall(UnicastConnection) method. I think a
better solution would be to modify the RMIObjectOutputStream class and
to use the object replacement mechanism of the ObjectOutputStream class.
I join a patch file for
libraries/javalib/kaffe/rmi/server/RMIObjectOutputStream.java . Of
course, the object replacement that reside in the UnicastRef class,
method invokeCommon(Remote, Method, Object[], int, long) can be removed
since it is handled by the RMIObjectOutputStream.
Sincerely,
Jeremy Buisson
--------------000105080503020803030103
Content-Type: text/plain;
name="kaffe.rmi.server.RMIObjectOutputStream-remote-references.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="kaffe.rmi.server.RMIObjectOutputStream-remote-references.patch"
14a15
> import java.rmi.server.UnicastRemoteObject;
20a22
> enableReplaceObject(true);
27a30,42
> protected Object replaceObject(Object obj) throws IOException {
> Object ret;
> if(obj instanceof UnicastRemoteObject) {
> ret = UnicastRemoteObject.exportObject((UnicastRemoteObject)obj);
> }
> else {
> ret = obj;
> }
> return ret;
> };
>
>
>
--------------000105080503020803030103--