• Post Reply Bookmark Topic Watch Topic
  • New Topic

NoSuchObjectException!!!  RSS feed

 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use RMI in my Client/Server Application. There are many API&APIImpl pairs. Others always work well. But a pair works wrong "sometimes". It works well in the most case, occasionaly it throws "NoSuchObjectException". I find the explanation in javadoc:
"A NoSuchObjectException is thrown if an attempt is made to invoke a method on an object that no longer exists in the remote virtual machine. If a NoSuchObjectException occurs attempting to invoke a method on a remote object, the call may be retransmitted and still preserve RMI's "at most once" call semantics."

I just want to know why the object in the remote side not exist. Why others work well, and this pair works well sometimes?

Thanks in advance.
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps it is related to leasetime by default lease time is 10mins. if your client remains idle for more than 10 minutes then remote ref. count is reduced & object on server side may be garbage collected(if remote ref. count goes to zero).]

Solution to this is Activation RMI.....which will create the object if it is not present when request hits server application.
OR

Increase leaseValue...i.e. java.rmi.dgc.leaseValue

Shrinivas
 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems resonable. But if as you said, why others work fine?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!