Problem loading java properties
Posted
by markovuksanovic
on Stack Overflow
See other posts from Stack Overflow
or by markovuksanovic
Published on 2010-04-23T12:43:47Z
Indexed on
2010/04/23
12:53 UTC
Read the original article
Hit count: 296
I am trying to load properties from a file (test.properties)
The code I use is as follows:
URL url = getClass().getResource("../resources/test.properties");
properties.load(url.openStream());
But when executing the second line I get a NPE. (null pointer exception)
I'm not sure what's wrong here... I have checked that the file exists at the location where URL points to...
Any help is appreciated....
© Stack Overflow or respective owner