wood burning stoves 2.0*
The moose likes Distributed Java and the fly likes RMI exception handling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI exception handling" Watch "RMI exception handling" New topic
Author

RMI exception handling

Dilip kumar
Ranch Hand

Joined: Oct 16, 2000
Posts: 360
Hi,
I'm writing a client/server application using RMI.
The method book ticket calls remote methods.
While testing the application I noticed that if I stop the server and then call this method errors are
displayed on dos prompt instead of displaying message dialog. Is my logic wrong ?
public void bookTickets(int recordNumber, int seats, int operatingMode) {
:
:
try {
:
:
}
catch (DatabaseException e) {
message = "1" + e.getMessage() ;
JOptionPane.showMessageDialog(null, message, "Book Tickets", JOptionPane.INFORMATION_MESSAGE );
}
catch (RemoteException e) {
message = "2" + e.getMessage() ;
JOptionPane.showMessageDialog(null, message, "Book Tickets", JOptionPane.INFORMATION_MESSAGE );
}
catch (Exception e) {
message = "3" + e.getMessage() ;
JOptionPane.showMessageDialog(null, message, "Book Tickets", JOptionPane.INFORMATION_MESSAGE );
}
}
The error displayed on dos prompt on client side is:
java.rmi.ConnectionIOException: Exception creating connection to 123.123.123.94; nested exception is
java.net.SocketException
Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: RMI exception handling