wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Configuration and Properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Configuration and Properties" Watch "Configuration and Properties" New topic
Author

Configuration and Properties

Bob Wheeler
Ranch Hand

Joined: Apr 24, 2009
Posts: 317
Hi there,

I have some questions relation to the configuration. And here we go:
i) If an exception was thrown (e.g. wrong port, no server available, etc. ) during the attempt to connect to the server, I show an error message and exit the configuration dialog. What do you say? Is this ok, any must criterion I have to look for? Should I give the user the opportunity to change the setting? But that would be additional work
ii) If a remote exception was thrown, I display an error message, which is not very precise ("network error. please wake up the administrator :-)"). I thought, that the user can't do anything with the exception message, so he should always shout for the administrator.
iii) If the property file is not accessible (broken, wrong permissions), I show a warning message. Afterwards the configuration continues or the application starts. I figured, that a property file error is not a serious one. Not so serious to disallow the application to start.

Looking for your answers.
cheers
Bob


SCJP 6 - SCJD - SCWCD 5 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2231
    
    7

Hi Bob, these threads will help
RemoteException?
client/server startup

The whole idea is once the config is saved, that's it. If these were the wrong config then the user wouldn't able to start the app. They would manually need to find that properties file and delete it then start all over. Therefore, it is best all error checking is done before saving to properties file.

About shouting for administrator during remote client startup... if the network server isn't running, network clients can't connect then yeah the admin is needed.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
Bob Wheeler
Ranch Hand

Joined: Apr 24, 2009
Posts: 317
Hi K.,
thanks for answering.
K. Tsang wrote:Hi Bob, these threads will help
RemoteException?
client/server startup

thanks for the links. I looked for answers for my Q (i) and (ii), which matches my work the best and I found it from Roel: Roel's answer. I know I'm lazy
K. Tsang wrote:
The whole idea is once the config is saved, that's it. If these were the wrong config then the user wouldn't able to start the app. They would manually need to find that properties file and delete it then start all over. Therefore, it is best all error checking is done before saving to properties file.

MMh, I can't follow you here. What you mean by "wrong" config and why should you then delete the property file? The only reason to manually delete or edit the property file is, then the property file is not accessible, e.g. wrong permissions, other accessible error.
I do the following in that case: until the user manually edits/deletes the property file, the user should still be able to run the app. He can't load or store the entered configuration data (all fields are always empty by start up), but he is able to run the app. At least that's how I am doing. Of course he gets a warning message each time the application starts.

cheers
Bob
 
 
subject: Configuration and Properties
 
Similar Threads
Test 252: Mock exam
000-341 sample test questions
Handling Runtime Exceptions and Fatal Checked Exceptions in the Client
Where to finally handle remote and database exceptions
Passed 700,701 and 340 last Thursday