This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes how to replicate a remote exception in a dev env? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "how to replicate a remote exception in a dev env?" Watch "how to replicate a remote exception in a dev env?" New topic
Author

how to replicate a remote exception in a dev env?

saran sadaiyappan
Ranch Hand

Joined: Dec 23, 2004
Posts: 39
Hi all,
I am aware that a remote exception thrown when some problem happens over the network, that we are trying to connect. But when I shut down the remote server I get a javax.naming.CommunicationException rather than a remote exception.

How can I replicate the remote exception as I want to display user frendly messages for those kind of exceptions.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17271
    
    6

Write a mock object, that you call that just throws a RemoteException.



Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17271
    
    6

Or do that same thing with an EJB on the server, and just throw the Exception.

Mark
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: how to replicate a remote exception in a dev env?
 
It's not a secret anymore!