am reading a .properties from a standalone class which is used to load the application properties. project is deployed on WAS6.5 as EAR file. When i tried to load the file, it is looking from AppServer\profiles\default\ . My .properties file is in web-inf. Please let me where do i need to configure to read that property files.
If its trying to read there, then you must be doing a direct File IO (using the File API perhaps?) which is not permitted in J2EE or more specifically WebSphere, except in cases that files are on network drives.
There are multiple ways to read properties files (search javaranch, I've posted about this multiple times in this forum) but the best way I've found is getResourceAsStream() which loads files from the class path. Keep in mind though, that doing so means the application must be re-deployed if you want to change the properties file.
thanks for your reply. i used the file reading as mentioned getResourceAStream() but it is also throwing the same null pointer exception. i want to know how the config/properties files are read from the web-inf folder.