aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes command line properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "command line properties" Watch "command line properties" New topic
Author

command line properties

Kelly Wood
Ranch Hand

Joined: Nov 07, 2004
Posts: 54
In my assignment spec, it states that the client and server must be executable using a command line of: java -jar <path_and_filename> [<mode>], without the use of any other command line arguments or properties. However in order to start up a rmi client/server, I need to specify at the very least the following:

-Djava.rmi.server.codebase
-Djava.rmi.server.hostname
-Djava.security.policy

Would it be acceptable to hard code the values of these properties in my main startup class?
Oricio Ocle
Ranch Hand

Joined: Nov 30, 2004
Posts: 284

Hello Kelly
My specs say:
Your programs MUST not require use of command line property specifications.

Regarding rmi.server.codebase:
Regarding RMI:
You MUST provide all classes pre-installed so that no dynamic class downloading occurs.

For rmi.server.hostname too:
I can't see your server requires overriding default values of these properties. In that situation you are centering in a very particular network configuration (for example when the clients are outside the server LAN, and "server localhost" can not be routed by them) and as particular it is, overriding their values would not be a requirement for a correct working...
And regarding java.security.policy:
Regarding RMI:
You MUST not require the installation of a security manager.

So, at least in my assignment, any of these properties are required.

Would it be acceptable to hard code the values of these properties in my main startup class

Ummm, all sentence with these magic words "hard code" might make you think twice.
In these situation is even worse since they are System properties, not parameters.

Hope this helps,
Regards, Ori


SCJP, OCMJD, OCMJEA
Oricio Ocle
Ranch Hand

Joined: Nov 30, 2004
Posts: 284

I' ve thinking:
well, if the application were run in some of those particular network environments, it would be required that rmi.server.hostname would be overwriten....:
And the best answer i can think is:
The same behaviour could be extrapolated to every system property, and changing their values via the GUI is without doubts out of the scope of this application.
Thirumurugan Mylrajan
Ranch Hand

Joined: Jan 26, 2006
Posts: 64
Originally posted by Oricio Ocle:
The same behaviour could be extrapolated to every system property, and changing their values via the GUI is without doubts out of the scope of this application.


I have a few reservations about this. One of my req said (I think yours will also..) "All configuration must be done via a GUI, and must be persistent between runs of the program".

So they are expecting atleast some configuration to be done with GUI.

If you dont use GUI, how do you plan to specify the hostname/IP of the server to the client.


SCJP , SCJD. (IBM 142 in progress).
Oricio Ocle
Ranch Hand

Joined: Nov 30, 2004
Posts: 284

Of course the configuration must be done via a GUI.
But it is different that, Systems properties being specified via a GUI.
Systems porperties have a default value and a standard way for overriding, via the -D<property> option of the app launcher.
What do you think?
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

Hi guys,

As long as we must use a configuration file (the suncertify.properties) I don't think that the system properties mechanism is really necessary.
I do all the configuration with the configuration file, here I have 2 kinds properties :
1.which can be changed with the actual configuration GUI (port, host, db file, etc)
2.which are not configurable with the actual GUI (rmi bind name, window ratio, etc)

I jusr rererereread my specs and I fish this :

Your programs must not require use of command line property specifications.


Regards M.
[ September 12, 2006: Message edited by: Mihai Radulescu ]

SCJP, SCJD, SCWCD, OCPJBCD
Thirumurugan Mylrajan
Ranch Hand

Joined: Jan 26, 2006
Posts: 64
I completely agree with Mihai.
Kelly Wood
Ranch Hand

Joined: Nov 07, 2004
Posts: 54
I must be missing something. When I run my server without specifying the codebase property in eclipse, I get a ClassNotFoundException. I also tried to load the class dynamically in the server (for testing purpose) using Class.forName(...) and it was successful. So I thought the codebase property is mandatory for rmi servers. But from the messages above it seems to be optional. Can someone fill me in on what I am missing?
Oricio Ocle
Ranch Hand

Joined: Nov 30, 2004
Posts: 284

Run rmic in order to generate server stubs for the client.
Regards
[ September 23, 2006: Message edited by: Oricio Ocle ]
 
Don't get me started about those stupid light bulbs.
 
subject: command line properties