Ah. Your code is running in an application server. In which case all you need do is put your resource in the classpath and read it in just as you were trying to do originally. However, you neeed to read the JavaDocs to see how you define where the resource is (an absolute path, like the one you have above, will not work).
That being said, what are you trying to do here? Are you trying to configure JBoss's mail service?
Joined: Dec 12, 2006
I have created one method which send mail and one more method which read the e mail address of receiver from mail.xml file.
till now my mail.xml file used to go in .war file so there wasn't any problem of reading xml file but now xml file won't go with .war file.. it will stay out somewhere in jboss directory...