File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI server IP/Port values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI server IP/Port values" Watch "RMI server IP/Port values" New topic
Author

RMI server IP/Port values

Surya Kumar
Ranch Hand

Joined: Aug 21, 2004
Posts: 52
I am using RMI for connecting to the server. I am getting the IP/Port settings from the properties file whichj will be in the default directory. In case that file is missing what's the value of IP/Port we can use that won't cause any conflicts! Thanxs in advance.


Regards<br />Prem<br />SCJP, SCJD, SCWCD, SCBCD, SCEA, SCJDWS
mike acre
Ranch Hand

Joined: Sep 23, 2003
Posts: 197
localhost/1099


SCJP 1.4, SCJD
T. Anthony Chen
Ranch Hand

Joined: Jul 28, 2004
Posts: 38
I haven't coded this part. But here is what I plan to do in general. When my client starts, I display a connection selection dialog, where the user can choose to connect either locally or remotely. I default the selections and properties (db location, port, ip) to what the user chose last time by reading from the properties file. If the user wants to keep everything unchanged, he just click OK and move on. If the properties file doesn't exist or the values aren't there, the dialog defaults to local connection. But the user can change the settings. After the user enters the values, I persist them to the properties file and make the connection accordingly to start the main GUI.


T. Anthony Chen<br />---------------<br />SCJP, SCJD, SCBCD, SCWCD, SCEA
Surya Kumar
Ranch Hand

Joined: Aug 21, 2004
Posts: 52
Mike

Using localhost as the IP: wont it cause the loopback!

Regards
mike acre
Ranch Hand

Joined: Sep 23, 2003
Posts: 197
Originally posted by Surya Kumar:
Mike

Using localhost as the IP: wont it cause the loopback!

Regards



Yes, but only in networked mode, if the examiner wants to test the requirement 'must not use network code' then they will run the standalone mode which should comply with that.
What default would you use for ip/host if not localhost, do you have a crystal ball handy?
Surya Kumar
Ranch Hand

Joined: Aug 21, 2004
Posts: 52
Mike

Ok from the server side we can use localhost. I have server port in the server side where the app is listening, and i have server location and server port in the client side. I can't hard code this in the properties file. For that reason the properties file has to be created the first time the application is run. During the first run the app asks for these three parameters using a UI and create the properties file. This is what i am planning to do. My questions is, Is this setup part necessary? Can't we supply the propertieds file with the jar file? Regards
mike acre
Ranch Hand

Joined: Sep 23, 2003
Posts: 197
You can have a properties 'resource' within the runme.jar this can hold the defaults and populate an empty or existing suncertify.properties 'file'.
That way the suncertify.properties 'file' is not required for the app to run.
For the sake of this assignment, I strongly advise the defaults to be set to 1099, localhost & for the DB file - root directory and provided file name.
Surya Kumar
Ranch Hand

Joined: Aug 21, 2004
Posts: 52
I thought that the db file is only in the working directory? Do you mean a user can point to a different file? Regards
Satish Avadhanam
Ranch Hand

Joined: Aug 12, 2003
Posts: 697
Originally posted by Surya Kumar:
I thought that the db file is only in the working directory? Do you mean a user can point to a different file? Regards


Yes. We must provide a way for the user to select location of db file. Individual requirements may vary. You might want to check your instructions to make sure.

Good Luck,
Satish.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI server IP/Port values
 
Similar Threads
Thoughts on handling RemoteException
RMI vs Sockets
Port Number while starting the server
port field
I am close to submit - question about suncertify.properties