6 Replies Latest reply on Apr 8, 2011 6:11 PM by jtahlborn

    Cannot Implement an extension of Remote and another custom interface

      Hello All,

      I have one issue that though I thought it simple has become a real challenge to me

      I have an interface call RegistrationService which is has a certain number of method and is working fine but I need to expose a certain portion of it via a remote interface (RMI). So I thought that I would extend the RegistrationService to create a RemoteRegService which will also extend java.rmi.Remote. Not a problem to this point.

      Now some methods in the RegistrationService throw a custom exception InvalidAccountException, so my new interface looks like

      public interface RemoteRegService extends Remote, RegistrationService{}

      Then I create an implementation for the interface like

      public class RemoteRegServiceImpl implements RemoteRegService{


      public void reviewAccount(HostAccount obj) throws InvalidAccountException, RemoteException{ //this

      Now the problem is that the code doesn't compile because the method reviewAccount in RegistrationService does not throw a RemoteException. And without the RemoteException, I cannot export my RegistrationService as a remote Object.

      Can someone give me a suggestion?