Tomcat & Property Files
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Steve_Hanks
Posted On:   Thursday, August 15, 2002 11:15 PM

I am using property files to allow for runtime instructions for certain configurations such as database username/password, javax.mail configurations such as SMTP server and username/password. Here is the problem. A file, known as db.properties (or mail.properties) is placed within the {Context}/WEB-INF/classes directory. Upon deployment, the classpath does not contain this directory, hence the file can not be found and an IOException is thrown stating that the file or folder is not found. If I provide a complete path from the root (file system root, not tomcat root), it works fine. I have tried adding the classes directory into the Tomcat classpath (within the tomcat.sh script) and I get an internal server error everytime (class not found exceptions).    More>>

I am using property files to allow for runtime instructions for certain configurations such as database username/password, javax.mail configurations such as SMTP server and username/password. Here is the problem. A file, known as db.properties (or mail.properties) is placed within the {Context}/WEB-INF/classes directory. Upon deployment, the classpath does not contain this directory, hence the file can not be found and an IOException is thrown stating that the file or folder is not found. If I provide a complete path from the root (file system root, not tomcat root), it works fine. I have tried adding the classes directory into the Tomcat classpath (within the tomcat.sh script) and I get an internal server error everytime (class not found exceptions).

Any ideas what to try next or have a link to documentation that can help me out? I appreciate any help...

   <<Less

Re: Tomcat & Property Files

Posted By:   Christopher_Koenigsberg  
Posted On:   Friday, August 16, 2002 06:45 AM

A file, known as db.properties (or mail.properties) is placed within the {Context}/WEB-INF/classes directory. Upon deployment, the classpath does not contain this directory, hence the file can not be found and an IOException is thrown stating that the file or folder is not found



?? Works fine for me! The WEB-INF/classes directory is already implicitly on the classpath, of any web application. You don't explicitly do anything to add it.

About | Sitemap | Contact