File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RemoteException Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RemoteException Problem" Watch "RemoteException Problem" New topic

RemoteException Problem

Eric Ushie
Ranch Hand

Joined: Dec 01, 2005
Posts: 31
Hi all my name is Ushie and i'm working on the B & S assignment.

In my assignment, the methods in the interface dont throw RemotException and when i implement my remote interface in my RMI server code i need to throw RemoteException. In the book i'm reading, i'm adviced not to throw any extra Exceptions not given in the interface. How do i goabout this?

Please can someone help me, is there a way to walk around this problem? Thanks so much in advance.
Mary John
Ranch Hand

Joined: Sep 17, 2007
Posts: 109

I too have the same assigment. I havent yet reached the stage of creating the remote object but the way I understand it is as follows/

You might need to create another interface, call it Service for eg.
and in this Service you might have your business methods for eg, book, searchexactname, searchexactlocation, searchnameandlocation,...etc to support your GUI features.
This service interface should extend remote and should be implemented by some class.

The service interface implementor should make use of DBAccess interface methods. So your remoteexceptions go in service interface.

This is just my simplistic understanding. I havent gone into the details yet. Others can provide more or correct me if I am wrong.

SCJP 5.0<br />SCJD working on it
Eric Ushie
Ranch Hand

Joined: Dec 01, 2005
Posts: 31
Hi Mary, On face value, i think i found my solution in your response - i stand corrected only if someone else comes up with a point that makes your approach to contravene the assignment instructions, or a better approach, otherwise, you're the bomb!

thanks so much.
Mary John
Ranch Hand

Joined: Sep 17, 2007
Posts: 109
Hi all,

recently had a thought on the reply that I posted here.
In the reply I gave I assumed that the "only" solution was a
so called "thin client". so here is what I gave previously.

GUI----> RMI------> Business Services---------> DBAccess-----> Data File

But the other solution was "fat client" as mentioned in the ever so
long "should lock methods be callable by client" .

GUI----> Business Services---> RMI---> RemoteDBAccess-->DBAccess-----Data File

I personally prefer the thin client solution. I have BS 2.2.1. There doesnt seem to much discussion these days on which to follow, because I guess both are equally acceptable(has its own pros, cons, and assignment instruction have statements here and there that seem to prefer both ways )

Denny's DVD book has the fat client solution, and some other posts
by Ken Krebs, Kaspar Thommen etc followed the thin client solution(which I
also prefer)

what have others done /doing recently for their assignment?
[ April 25, 2008: Message edited by: Mary John ]
I agree. Here's the link:
subject: RemoteException Problem
It's not a secret anymore!