users@glassfish.java.net

Re: properties file in EAR

From: <glassfish_at_javadesktop.org>
Date: Tue, 19 Aug 2008 09:10:36 PDT

Hello Patbos,

Thanks, that worked.

For loading properties:

[code]
props.load(this.getClass().getClassLoader().getResourceAsStream("common.properties"));
[/code]

As for log4J. I tought it would work just by putting log4j.jar in glassfish/lib (as some hibernate libraries depend on it, i put it there together with the hibernate libs), although that didn't give an error (ClassNotFound) in my ear project, it didn't log anything.
I also put the log4j.jar in the ear lib folder which solved the problem and log4j loads the property automatically.

regards
[Message sent by forum member 'marlor' (marlor)]

http://forums.java.net/jive/thread.jspa?messageID=294168