• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Handling Exceptions

 
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
My Remote Object throws a checked exception(ex record not found) . I handle this exception and rethrow a new RemoteException. Hope this is how exceptions are handled in RMI.
At the client side i am able to catch this exception. However I am not able to get back the MyException.toString() part of the Exception. Doesn't the RemoteException return back the toString() part via the network??.
Hope i have clarified what problem i have.
 
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Rahul.
When you throw the RemoteException, use the constructor that takes a String message and a Throwable to wrap. You can wrap the original exception in the RemoteException.
Jerry
 
What's brown and sticky? ... a stick. Or a tiny ad.
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic