Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

General: RMI - Help

 
S. Ganapathy
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
Here I am facing some problem.
I have an interface
DBClient {
    public String[] getRecord(long recNo) throws RecordNotFoundException;
}
and I have a remote interface
public interface DBClientRemote extends Remote, DBClient{
}
DBClientImpl extends UnicastRemoteObject, implements DBClientRemote {
    puvlic Stirng[] getRecord(long recNo) throws RecordNotFoundException, RemoteException {
        //some implementation
    }
}
While compiling the above code, i am getting the following error:
"overridden methods does not throw java.rmi.RemoteException"
I don't have any clue on this. In Max's book also same thing is followed. Can any body help me!
Ganapathy
[ May 07, 2003: Message edited by: S. Ganapathy ]
 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think there should be a constructor:
public DBClientImpl() throws RemoteException{}
 
S. Ganapathy
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi damu,
Constructor is also provided, but not shown in the code. Sorry for that.
Ganapathy
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

thats your problem, your DBClient does not throw remote exception, have it throw Exception instead, or better yet, as Barry pointed out a few times RemoteException is an IOException, I'm sure you can take it form there
 
S. Ganapathy
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ta Ri Ki Sun,
Thankyou very much. I forgot to throw IOException in DBClient interface.
Thankyou once again.
Ganapathy
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by S. Ganapathy:
Hi Ta Ri Ki Sun,
Thankyou very much. I forgot to throw IOException in DBClient interface.
Thankyou once again.
Ganapathy

you're welcome Ganapathy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic