File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about server error handling

 
AutinHorse
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the "Marking" part on my assignement document, they said they will give score for server error handling, but I can not find any thing special for server to do the error handling. I only catch all the IO or DB exception, new RemoteException and throw them out. In the client side, I catch all exception, for all the exception, I show a message box and then System.exit().
Is it OK or I need do something more?
Thank for any suggestion.
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the most part, yes. But waht about an exception that occurs when you start up the server. No client has started, so who is it supposed to forward these exceptions too? Let alone if there was many clients, which client gets that error?
So you need the same solution as the client side for the server side for exceptions that occur on the server side, so on that side also have a Message that pops up telling the user the error.
Mark
 
hao li
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the most part, yes. But waht about an exception that occurs when you start up the server. No client has started, so who is it supposed to forward these exceptions too? Let alone if there was many clients, which client gets that error?
Hi Mark,
Can you give me more detail about it. I really
don't catch you.
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi hao,
I think what Mark is trying to say is there are errors that are specific to the server and errors that are specific to individual clients. For example on server startup a BindException or maybe even MalformedURLException could be thrown. If there were a tricky bug on the client that occasionally creates a poorly formed record for modify and causes a DatabaseException to be thrown, you certainly wouldn't want every connected client to receive that exception.
Hope this helps,
Michael Morris
 
hao li
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there were a tricky bug on the client that occasionally creates a poorly formed record for modify and causes a DatabaseException to be thrown, you certainly wouldn't want every connected client to receive that exception.
But in my design, every client has its own remote
database object using singleton pattern, It seems
a DatabaseException of one client will not affect
the other cleint. Is it right?
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Hao,

But in my design, every client has its own remote
database object using singleton pattern, It seems
a DatabaseException of one client will not affect
the other cleint. Is it right?

Yep. As long as each client has its own connection object, then RMI will marshall all the exceptions and send them to that client.
Michael Morris
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic