This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes How does RMI handle exceptions? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "How does RMI handle exceptions?" Watch "How does RMI handle exceptions?" New topic
Author

How does RMI handle exceptions?

Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
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?


Reid - SCJP2 (April 2002)
Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

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.
 
Don't get me started about those stupid light bulbs.
 
subject: How does RMI handle exceptions?
 
Similar Threads
Remote client and Data client
RMI: A few questions
Exception Handling with Webservices
HELP: Muilt-Threaded Server
Using java.util.logging.Logger and passing the assignment