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

how to replicate a remote exception in a dev env?

 
saran sadaiyappan
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write a mock object, that you call that just throws a RemoteException.



Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or do that same thing with an EJB on the server, and just throw the Exception.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic