I have a non-avalon application that loads properties using a singleton
class with static accessor attributes.

This typically happens on VM startup and the properties are pulled in
from a property file accessible from the system classpath.

So the static initializers for attributes are loaded up-front even
before any of the lifecycle methods are called on my startup class.

I am moving this application to Avalon framework.  Including
myprops.properties  in SAR-INF/myprops.properties does not seem to load
any of the properties using:

InputStream in =
MySingltonClass.class.getClassLoader().getSystemResourceAsStream (
myprops.properties ); 

I get run time NullPointerException when trying to load the properties
using above.


I know config.xml is for configuration accessible during implementation
lifecycle.  But I don't want to use it (yet) for two reasons:

1) I have tons of properties being read in that don't care to create xml
tags for. These are all attr=value format.
2) It seems that I have to pass around Configuartion object to all
classes requiring use of the properties.  A singleton seemed to fix
that.


I even bundled my SAR with  SAR/lib/myprops.properties and still got a
run time NullPointerException on loading the file.


Can anyone suggest what is going on?   and also point me to document
that explains how external property files from classapath and the SAR
directory structure required to do this?



regards
k.










---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to