classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rmi vs cajo


From: Andrew Haley
Subject: Re: rmi vs cajo
Date: Tue, 13 Sep 2005 15:03:52 +0100

Mark Wielaard writes:
 > 
 > While playing a bit with Cajo
 > (http://wiki.java.net/bin/view/Communications/ProxyUsage) I got the
 > following error:
 > 
 > java.lang.NullPointerException
 >    at gnu.cajo.invoke.Remote.hashCode (Remote.java:510)
 >    at java.util.Hashtable.hash (Hashtable.java:822)
 >    at java.util.Hashtable.put (Hashtable.java:432)
 >    at gnu.java.rmi.server.UnicastServer.exportObject (UnicastServer.java:66=
 > )
 >    at gnu.java.rmi.server.UnicastServerRef.exportObject (UnicastServerRef.j=
 > ava:110)
 >    at java.rmi.server.UnicastRemoteObject.exportObject (UnicastRemoteObject=
 > .java:83)
 >    at java.rmi.server.UnicastRemoteObject.<init> (UnicastRemoteObject.java:=
 > 69)
 >    at gnu.cajo.invoke.Remote.<init> (Remote.java:486)
 >    at gnu.cajo.utils.ItemServer.bind (ItemServer.java:206)
 >    at ProxyTest.main (ProxyTest.java:38)
 > 
 > It seems we are to eager to export the Remote object immediately (from
 > the constructor). We want to put it in a Hashtable and call hasCode(),
 > but for the cajo Remote object the item field used to calculate the
 > hashCode() hasn't been set yet so that gives a NullPointerException.

Isn't this a simple failure by gnu.cajo.invoke.Remote to satisfy the
contract for hashCode()?  As I understand it, hashCode() should not
throw any exception.

Andrew.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]