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 / First Aid / June 2005

Tip: Looking for answers? Try searching our database.

Constructor doesnt work

Thread view: 
Irlan agous - 11 Jun 2005 09:45 GMT
Hello, I want to put rmi in my application. When i make the server i have
this construction:

Patient patient = new Patient();
           System.out.println("Binding...");

           Naming.bind("PatientServer", patient);
           System.out.println("PatientServer is ready...");

Then i get this error message: And Patient.class exist!!!!

sapa1/PatientServer.java [26:1] cannot resolve symbol
symbol  : constructor Patient ()
location: class sapa1.Patient
           Patient patient = new Patient();
                             ^
sapa1/PatientServer.java [29:1] bind(java.lang.String,java.rmi.Remote) in
java.rmi.Naming cannot be applied to (java.lang.String,sapa1.Patient)
           Naming.bind("PatientServer", patient);
                 ^
2 errors

Can anyone help me pls
Bjorn Abelli - 11 Jun 2005 11:57 GMT
"Irlan agous" wrote...

> Hello, I want to put rmi in my application.
> When i make the server i have this construction:
[quoted text clipped - 11 lines]
> location: class sapa1.Patient
>            Patient patient = new Patient();

Read the error again:

 cannot resolve symbol :
 constructor Patient ()

That is that you don't have an *empty* constructor in Patient, which means
you can't instantiate it that way. Look up in your Patient class with which
arguments you need for instantiating a Patient.

And it also seems that your "Patient" doesn't implement the interface
Remote.

bind(java.lang.String,java.rmi.Remote)
cannot be applied to (java.lang.String,sapa1.Patient)

// Bjorn A
Irlan agous - 11 Jun 2005 13:41 GMT
Thanks,  but it didnt work.

The Patient(the impl) already extends UnicastRemoteObject, teh problem is
also that i cant expend also DataModel that makes the database connection. I
am a newbie in this case, I will show you the files:

Patient.java

import java.rmi.*;
import java.rmi.server.*;

public class Patient extends UnicastRemoteObject implements PatientInterface
{

}

PatientServer.java
import java.rmi.*;

public class PatientServer
{

   public static void main(String[] args)
   {
       try
       {
           if (System.getSecurityManager() == null)
           {
               System.setSecurityManager ( new RMISecurityManager());
           }
           Patient patientImpl = new Patient();
           System.out.println("Binding...");

           Naming.bind("PatientServer", patientImpl);
           System.out.println("PatientServer is ready...");

       }
       catch (Exception e)
       {
           e.printStackTrace();
       }
   }

}

I would appriciate if i can send you the files, and you can take a look, i
would even be willing to pay, becouse i really need to unerstand this

Thanks in advance

Irlan

> "Irlan agous" wrote...
>
[quoted text clipped - 30 lines]
>
> // Bjorn A


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.