Re: OT: RE: Problem in Locating a properties File (Not application.properties)

2004-10-19 Thread Jeff Beal
From the documentation for java.lang.ClassLoader: " The name of a resource is a "/"-separated path name that identifies the resource." That is, try /resources/storageDirectory.properties. Caroline Jen wrote: Okay, this code works if I put the properties file in the WEB-INF\classes directory: fina

Re: OT: RE: Problem in Locating a properties File (Not application.properties)

2004-10-19 Thread Caroline Jen
Okay, this code works if I put the properties file in the WEB-INF\classes directory: final String PROPFILE = "storageDirectory.properties"; Properties oProp = null; oProp = new Properties(); oProp.load( getClass().getClassLoader().getResourceAsStream( PROPFILE ) ); I really would like to

Re: OT: RE: Problem in Locating a properties File (Not application.properties)

2004-10-19 Thread Caroline Jen
I tried: final String PROPFILE = "storageDirectory.properties"; Properties oProp = null; oProp = new Properties(); oProp.load( getClass().getClassLoader().getResourceAsStream( PROPFILE ) ); Now, I got: java.lang.NullPointerException java.io.Reader.(Reader.java:61) java.io.InputSt

OT: RE: Problem in Locating a properties File (Not application.properties)

2004-10-19 Thread Hiran.Chaudhuri
Hi, Caroline. Your code tries to open a file from the filesystem, and since the path you specified is invalid from the current working directory you get a FileNotFoundException. Try a oProp new Properties().load (getClass().getClassloader().getResourceAsStream(PROPFILE)); Hiran --