permaculture playing cards*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI Server" Watch "RMI Server" New topic
Author

RMI Server

Kris Reid
Ranch Hand

Joined: Jan 05, 2005
Posts: 247
I have the RMI working perfect, I just have to start the server maually.

How does the server get started?
It says that the program gets started using the jar file with max one argument.

I want to add a popup box for the client to enter the IP address of the server to connect with but who starts the server?
Eric Chang
Ranch Hand

Joined: Jan 27, 2004
Posts: 113
The server gets by running the jar file with the server argument. The client gets run by running the jar file with no argument or in standalone mode by using the alone argument.
So in summary, the jar file should contain both the server and the client.
Kris Reid
Ranch Hand

Joined: Jan 05, 2005
Posts: 247
I'm doing the URLyBird project.
It states that it can be started with no arguments or alone which uses no netwroking.

So what I have done now is when you start the program it pops a Dialog up with 2 options.

1 - start server which starts on localhost and connects to it.
2 - Enter IP address and it connects to that server

Is this a valid solution?
Frans Janssen
Ranch Hand

Joined: Dec 29, 2004
Posts: 357
Kris,

Are you really sure your instruction only state two options? Mine stated three options: server, alone and none. The server option was of course to start the server.

It sounds strange to me that your instructions would not mention how to launch the server. It is not an issue Sun would want to leave to the individual candidate, I would think.

Frans.


SCJP 1.4, SCJD
Eric Chang
Ranch Hand

Joined: Jan 27, 2004
Posts: 113
I agree with Frans, I think you should reread your assignment, as I had the URLyBird assignment as well.
Kris Reid
Ranch Hand

Joined: Jan 05, 2005
Posts: 247
Sorry my mistake....it does have none, alone & server

Can I just confirm one thing.

When the user starts with none. It doesn't start the server it just tries to connect to the server and would throw an error if server is not running?

Or does it start the server as well?

Also is the server address always localhost? So is the user unable to run the program from a different machine?
Paul Bourdeaux
Ranch Hand

Joined: May 24, 2004
Posts: 783
When the user starts with none. It doesn't start the server it just tries to connect to the server and would throw an error if server is not running?

Or does it start the server as well?

Also is the server address always localhost? So is the user unable to run the program from a different machine?

When you start with no command line arg (none), it doesn't start the server. The server should be started in a different JVM using the server arguement. You should not assume that the server address is always going to be localhost. The user should be able to configure the IP address of the server and store this configuration in the suncertify.properties file.


“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
Eric Chang
Ranch Hand

Joined: Jan 27, 2004
Posts: 113
Yes, you should be able to start the Server on a totally different machine from the Client.
Look at it this way, you are developing TWO applications, a Server and a Client, you just have to bundle them together into one application, which is run with 3 different arguments.
When you run in standalone mode, you don't want to have anything to do with the Server at all. When you run with no argument, you are just running the Client, which will attempt to connect to the Server using parameters that the User provides (via whatever method you want). When you run with the server argument, you start the Server using parameters that the User provides (again, via whatever method you want).
Kris Reid
Ranch Hand

Joined: Jan 05, 2005
Posts: 247
Thanks guys

Do you have to use a properties file?

when started with none I have a Dialog pop up and ask for the IP or hostname of Server. It then attempts to connect.
Why would I have to save that information?
Eric Chang
Ranch Hand

Joined: Jan 27, 2004
Posts: 113
Again, I recommend you reread your assignment carefully. There should be a requirement that states the Server or Client must be able to run with the same settings on concurrent runs of the application. You don't want the user to have to enter in the same IP/Port/Database file location multiple times if it's the same everytime do you?
 
 
subject: RMI Server
 
Similar Threads
about the stop rmi
James Mail Server
Applet with RMI ,how to place into Tomcat?
Simple RMI Question ...
RMIRegistry on Solaris