You don't need an absolute path.
If the properties file is located in your archive, it is in your apps class path, too.
Use the ContextClassLoader for loading it.
Thank for your response.
I don't need absolute path and must use the ContextClassLoader. But can you give me an example on how to use it and get my properties file ?
Let's say your property file "myProp.properties" is located at top level in one of your JARs:
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("myProp.properties");
Doesn't work for me.
Here is my configuration :
The properties file is in the static.war archive.
The path is : /dir1/dir2/MyFile.properties
The class needing this properties file is located in the MyEJB.jar archive.
I tried :
InputStream is = Thread.currentThread()
The "is" input stream is always null.