Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How does RMI handle exceptions?

 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I did a quick troll through the RMI spec, and unless I overlooked something I couldn't find the answer to the following question.
What does RMI do if the server code results in an exception or error? Does the client receive the exact same kind of error? For example, would the client get an ArithmeticException for an integer divide-by-zero on the server? Or do all exceptions get wrapped in into some kind of RemoteException?
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without looking I would assume the client will receive the exact exception. If its a checked exception I believe the client would be forced to catch it anyway, so why not pass along the unchecked exceptions too? I think remoteExceptions are reserved for things related the the remote nature of a specific issue that causes the exception and not something like arithmetic.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic