aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes User message when server is out Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "User message when server is out" Watch "User message when server is out" New topic

User message when server is out

Fernando Franzini
Ranch Hand

Joined: Jan 09, 2009
Posts: 486

Hi folks
I've thought how to show a friendly message error to user when application server is out for some reason.
What I've done is:

that way, the message is not friendly...look here:
Connection refused to host:; nested exception is: Connection refused: connect

What do you think guys ? Any sugestion ?

Fernando Franzini - Java Blog
Roberto Perillo

Joined: Dec 28, 2007
Posts: 2270

E ai Fernando!

Champion... how about this:

You may also want to add to the message e.getMessage() or e.getLocalizedMessage().

Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Roel De Nijs

Joined: Jul 19, 2004
Posts: 6344

Hi Fernando,

I caught the RemoteException and showed a user-friendly message like Roberto is showing in his post. The detailed exception message could be shown too, or you can decide to write that one to log file.

I just showed my user-friendly message and that's it (because there is no logging requirement I turned logging completely off, so no sense to log the exception).

Kind regards,

SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
It is sorta covered in the JavaRanch Style Guide.
subject: User message when server is out