File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes tomcat - read external properties file from jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "tomcat - read external properties file from jar" Watch "tomcat - read external properties file from jar" New topic
Author

tomcat - read external properties file from jar

Quiddo Quitch
Ranch Hand

Joined: Apr 21, 2008
Posts: 38
I created a jar (myjar.jar) file that I placed in the lib directory of my webapp. The jar file I created needs to read from a properties file that is in a different directory. When I try to specify the path to this properties file I am getting an exception.

The code I am using



Dir structure below

How can I specify the correct path?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

What exception are you getting?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tomcat - read external properties file from jar
 
Similar Threads
WSAD & JAR Files
Writing to properties file in WEB-INF
Path to store Embedded Database files
Classpath Issues with java -jar option
Best place for .properties file?