Java Properties ?

Hello,

I would like to use Java Properties to store some config things in my application. Here is the code I use :


        InputStream reader=ClassLoader.getSystemResourceAsStream("/WEB-INF/classes/wekkit.properties");
        conf.load(reader);
        reader.close();

Next, I deploy my application as a WAR file and run it on a Jetty server. Unfortunately, even if the wekkit.properties is in the right path in the WAR file, I’ve got a NullPointerException when I try to use this piece of code…

Where is the problem ? Did I missed something (in web.xml ?) ?

Thanks !

Nobody could help me ? ^^’

I’m sure a lot of people can help you, but that doesn’t mean they will get to your question right away.

For one thing, which line exactly is giving you the NPE? Am assuming the ‘reader’ object is null, which is because you’re using the wrong path. Try dropping the ‘WEB-INF/classes’ part – the classes dir is the root of your classpath, and you’re trying to load something by classpath and not by file system.

To get more information more quickly, you
can try this
.

Cheers,
Bobby