| 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: 244
|
|
|
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]
|
 |
 |
|
|
subject: how to make sure rmi object is exported
|
|
|