Your code is using the System Classloader to locate the properties file. And that might be the reason why the properties file is not being located and resulting the NullPointerException. Did you try the code in my earlier post?
Originally posted by Jigar Naik: my smtpHost.properties file is in SendMail (the name of project dir) ----> config ----> smtpHost.properties
and the structure of my SendMail.war file is
SendMail.war---> config---> smtpHost.properties
As mentioned in one of my earlier posts, i had assumed that the properties file was at the root of the application. Now since the properties files is inside a folder named config, you will have to change the code to:
The rest of the code remains the same.
Joined: Dec 12, 2006
ya i have tried the same... but its still giving null...
now i m putting the properties file at my desktop and giving it a full path... to c drive...