• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

overridden method does not throw RemoteException

 
ravi janap
Ranch Hand
Posts: 389
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have defined the public methods of Data class in a DataInterface. I have also defined a RemoteDataInterface which extends DataInterface and Remote. These methods throws Remote Exceptions .
I have made DataServer class implements RemoteDataInterface. When I compile DataServer , I get the following exception
xyz() method in DataServer cannot implement xyz() in DataInterface;overridden method doesnot throw java.rmi.RemoteException .
Where am I going wrong ?
-- Ravindra
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I am not mistaken, your DataInterface must be defined to throw RemoteException also.
DataInterface -- Methods throw RemoteException
RemoteDataInterface extends Remote , methods throw RemoteException.
RemoteDataInterfaceImpl- methods need not throw RemoteException.
 
ravi janap
Ranch Hand
Posts: 389
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have made my Data class to implement the Data interface which I use in local mode so I can't make the methods in DataInterface to throw RemoteException
Thanks
-- Ravi
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic