This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes how to make sure rmi object is exported Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "how to make sure rmi object is exported" Watch "how to make sure rmi object is exported" New topic
Author

how to make sure rmi object is exported

Simon Simbolon
Greenhorn

Joined: Apr 15, 2010
Posts: 5
Is there any way I can make sure that an object has been exported when I called UnicastRemoteObject.exportObject(Stub,0)?

I'm having some cases when running the server apps with no exception, but sometimes the exported object is not found by the client, therefore producing this:

RemoteException
java.rmi.NoSuchObjectException: no such object in table

please help?
Pierre Sugar
Ranch Hand

Joined: Dec 08, 2002
Posts: 62

There are sevaral forums discussing the topic. The reason to that is that the object on the server has been garbage collected like stated in the forums. To avoid this you have to hold a reference to the object. Details you can find e.g. at sun's forum, Stackoverflow or here.


Pierre
Ram Narayan.M
Ranch Hand

Joined: Jul 11, 2010
Posts: 247

Did you put the RemoteObject in rmiregistry using Naming or Registry bind() or rebind() methods?... Using exportObject() means that the Object is eligible to be placed in Naming service...


SCJP 6 [SCJP - Old is Gold]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to make sure rmi object is exported
 
Similar Threads
RMI
RMI Question: Is server a thread?
RMI Object Exportation
AS400 Class not found exception
wait() in web services