I have a property file in the classpath of my application.
src/main/resources/default.properties
In an ejb, it has singleton and startup annotations, I try to read the file as following
Thread.currentThead().getContextLoader().getResource("default.properties");
This doesn't work. Works in Glassfish though.
Is there any way to read classpath resource in wildfly?
I found the solution.
The call
Thread.currentThead().getContextLoader().getResource("default.properties");
Doesn't work, but the following works.
InputStream is = Thread.currentThread ().getContextClassLoader ()
.getResourceAsStream ( "default.properties" );
I don't know why it is so, but may be this will help.