Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Remote Exception handling

843793Feb 16 2004 — edited Feb 16 2004
Hi All,

I've taken over support of a large RMI (Swing client) application, currently investigating the cause of the server just spinning it's wheels sometimes when a client submits a task to be run on the server. When this happens the server hangs until the client machine is rebooted (Win98 - PC lockdown means no access to kill the process), then the server goes on it's merry way again.

I think I may have found what may be a cause of this happening - but I need some gurus to verify it for me!! :)

Ok. The client submits a task to run on the server, the server should set it running and update the client to advise that it's been successfully submitted to run. Here's a simplified version of the method:

public String scheduleTask(Task task) throws RemoteException
{
String response = "";
try
{
server.scheduleTask(task);
response = "Task scheduled successfully";
client.notify(response);
}
catch (Exception e)
{
response = "Task scheduling failed";
client.notify(response);
}
finally
{
return response;
}
}

I may be wrong, but my assumption is that if there is say, hmm - a network issue and the try fails because the server can't notify the client, am I correct in assuming that the RemoteException doesn't get passed up the chain because the generic "Exception" is being (poorly) handled?

If this happens, could it cause the server to just hang (it never appears to timeout)?

Eagerly awaiting much feedback and laughter about the exception handling.

Paul C.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 15 2004
Added on Feb 16 2004
6 comments
168 views