Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

command line properties

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 284
Netbeans IDE Firefox Browser Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Oricio Ocle
Ranch Hand
Posts: 284
Netbeans IDE Firefox Browser Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Oricio Ocle
Ranch Hand
Posts: 284
Netbeans IDE Firefox Browser Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Thirumurugan Mylrajan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I completely agree with Mihai.
 
Kelly Wood
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 284
Netbeans IDE Firefox Browser Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Run rmic in order to generate server stubs for the client.
Regards
[ September 23, 2006: Message edited by: Oricio Ocle ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic