Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to make sure rmi object is exported

 
Simon Simbolon
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 62
Java Ruby Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ram Narayan.M
Ranch Hand
Posts: 247
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic