I did add:
NSBundle.mainBundle.properties().list(System.out); which lists all the properties and keys it can find.
And at one point in execution the properties where all there! But at a prior time they were not. I thought it may be the how or when the properties were accessed, they were used to initialize Strings in a static block like:
public interface PropertyStrings {
final static String LOG4JCONFIGFILE = System.getProperty("log4jconfigfile");
// For MedImage importerer & logs
final static String IMPORTLOGFILENAME = System.getProperty("importLogFilename");
final static String IMPORTLOGDESTFILENAME = System.getProperty("importLogDestFilename");
final static String IMPORTERDESTINATIONDIR = System.getProperty("importerDestinationDir");
.....
}
Which works fine for WOApp, when launched in the regular manner. ( I hear somebody changed Java, and now its easy to bring in constants with a: import static ..... statement. )
When the static block is first referenced the Strings should be initialized; they were being set to null, the problem I had, in case anybody forgot. I added a static reference to the main bundle first, before the strings got initialized, to reference and see what was in the bundle when the static block gets initialized.
public interface PropertyStrings {
static NSBundle MYBUNDLE = NSBundle.mainBundle(); << NECESSARY
final static String LOG4JCONFIGFILE = System.getProperty("log4jconfigfile");
// For MedImage importerer & logs
final static String IMPORTLOGFILENAME = System.getProperty("importLogFilename");
final static String IMPORTLOGDESTFILENAME = System.getProperty("importLogDestFilename");
...
}
and just by referring to NSBundle.mainBundle() first the System.getProperty() methods then properly initialize the static Strings, and everything works. I don't need to call WOApplication.primeApplication() or anything else. It seems a little strange, but it seems the woapp environment isn't quite set up. If I comment out the statement:
static NSBundle MYBUNDLE = NSBundle.mainBundle();
then it all the Strings get initialized to null, and if I leave it in, then they get their values.
Moral of story: access your NSBundle early, as things don't seem to be setup properly until you do ( or some call from some part of the WO framework does, but this may occur much later than you want.)
Mr. G Brown