Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / June 2005

Tip: Looking for answers? Try searching our database.

Overriding problems in rmi

Thread view: 
Daniel - 17 Jun 2005 13:56 GMT
I want to implement rmi and get this error

test/PatientGui.java [151:1] getEnToonData() in test.PatientGui cannot
override getEnToonData() in test.ViewModel; overridden method does not throw
java.rmi.RemoteException

Public class PatientGui
 void getEnToonData() throws java.rmi.RemoteException
{

}

Public Class ViewModel

void getEnToonData()
  {
     System.out.println("Moet nog gemaakt worden in de sub-class");
  }

If i remove the throws java.rmi.RemoteException, the compiler tells me it
should be thrown.

How can i solve this?
Thanks

Daniel
Mike Amling - 17 Jun 2005 19:31 GMT
> I want to implement rmi and get this error
>
[quoted text clipped - 5 lines]
>   void getEnToonData() throws java.rmi.RemoteException
> {
   void getEnToonData() {
    try {

    } catch (java.rmi.RemoteException r) {
      // Do something.
    }

> }
>
[quoted text clipped - 9 lines]
>
> How can i solve this?

  Catch it within the method.

--Mike Amling
Daniel - 18 Jun 2005 10:46 GMT
Thanks a lot,

Now it works but i got something strange, I have \running server .the Client
starts but not like its suppose to

in my implementation file to bind the rmiserver with i have
a start method, so that PatientControl will be initialized

  public void start() throws java.rmi.RemoteException
  {

    String titel = "SAPA versie 3.6.3     1 juli 2004";
    PatientControl app3 = new PatientControl(titel);

  }

On the PatientInterface i want to intitialize the start() method
import java.rmi.*;

public interface PatientInterface extends Remote
{
   public void start() throws RemoteException;
}

The PatientClient will initialize start from within the PatientInterface

      PatientInterface patient = null;
       try
       {
           System.setSecurityManager(new RMISecurityManager());

           patient =
(PatientInterface)Naming.lookup("rmi://localhost/PatientServer");

           //String titel = "SAPA versie 3.6.3     1 juli 2004";
          // PatientControl app3 = new PatientControl(titel);
           patient.getPatientNummer();
       }
       catch( Exception e1)
       {
           e1.printStackTrace();
       }

Thanks

Daniel
>> I want to implement rmi and get this error
>>
[quoted text clipped - 30 lines]
>
> --Mike Amling


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.