This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure 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
  • 0
  • 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: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • 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: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • 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