tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <>
Subject Re: JAR file not finding external properties files
Date Tue, 01 May 2007 19:53:24 GMT
Oh.... helps to read all the message:)

 jars in common/lib can't read files in your webapp. You could use 


David Smith wrote:
> Your could put the properties file in WEB-INF/classes which is 
> equivalent to storing it in the jar file.  Otherwise we'll need to 
> know more about where you are storing your properties file to help.
> -- David
> Mike Peremsky wrote:
>> I created some utility classes that read proeprties files (e.g. 
>> com.mvp.utils.ExtProperties). In the method where I try to load the 
>> properties file I have
>>         package com.mvp.utils;
>>      class ExtProperties {
>>         private static PropertyResourceBundle loadProperties(String 
>> propsFile) {
>>            PropertyResourceBundle prb =
>>            (PropertyResourceBundle) ResourceBundle.getBundle(propsFile);
>>           return prb;
>>      }
>>   }
>>         This file is then compiled and placed in a jar file, which is 
>> copied to my Tomcat\common\lib directory. Whenver I try to call the 
>> ExtProperties class it fails to find the properties file. If I 
>> include the properties file in the jar file it finds it with no 
>> problem. I assume that this is a class loader problem (which which I 
>> am not very familiar).
>>      What do I need to do to get the class in the jar file to find 
>> the properties files external to it? Do I need to specify the full 
>> path to the file?
>>      TIA
>>      - Mike
>>        ---------------------------------
>> Ahhh...imagining that irresistible "new car" smell?
>>  Check outnew cars at Yahoo! Autos.

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message