Hiii... I want to get the content of properties file into InputStream class object using getSystemResourceAsStream(). I have built the sample code. It works well using
The SystemClassLoader
loads resources from java.class.path
witch maps to the system variable CLASSPATH
. In your local application, you probably have the resource your trying to load configured in java.class.path
variable. In the server, it's another story because most probably the server loads your resources from another class loader.
Try using the ClassLoader
that loaded class using the correct path:
getClass().getResourceAsStream(fileName);
This article might also be useful.