Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 70697 invoked from network); 1 May 2007 21:24:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 May 2007 21:24:13 -0000 Received: (qmail 88977 invoked by uid 500); 1 May 2007 21:24:05 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 88952 invoked by uid 500); 1 May 2007 21:24:03 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 88941 invoked by uid 99); 1 May 2007 21:24:03 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 May 2007 14:24:03 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [209.73.178.66] (HELO web60018.mail.yahoo.com) (209.73.178.66) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 01 May 2007 14:23:56 -0700 Received: (qmail 79220 invoked by uid 60001); 1 May 2007 21:23:35 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=nF5n49xlrpwiH6sKnp4euYj81KLf4aRKxDtFrGsCCL64lRYYx4HYU4K+Cc9MR2o5TPvmEGUMkBVmmmx/kL/7fUJaOa18st8ZLEBefgfEOLehzXXjFb2EBnw/nOwVSf8p3/62r6hIeWq2gpj3yIhTD49m0rGBKIUijoy7qNykN3g=; X-YMail-OSG: ICreuPEVM1nK_X8D0Wf5iVFzpESLFZpLFOWUEtOctkM05LGmIgrFEsaeim17YOirHJc1AiPOlqBXy__szMMHSPXABxWjqQHoYoTGnvx5Z7I2S2VKscfJsRYsyifhFRI- Received: from [207.140.148.33] by web60018.mail.yahoo.com via HTTP; Tue, 01 May 2007 14:23:35 PDT Date: Tue, 1 May 2007 14:23:35 -0700 (PDT) From: Mike Peremsky Subject: Re: JAR file not finding external properties files To: Tomcat Users List In-Reply-To: <888863.49615.qm@web60024.mail.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1307972947-1178054615=:79209" Content-Transfer-Encoding: 8bit Message-ID: <645046.79209.qm@web60018.mail.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org --0-1307972947-1178054615=:79209 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Ah, I got it. I put the .jar file in the common\classes directory. But putting thproperties files in the common\classes direcotry works. I'm a dunce, missed that in the email below. Mike Peremsky wrote: Rashmi, I just tried this and it does not work either. It is still not finding the property file. I have verified that the class file in the jar is located at \com\mvp\utils. I also tried keeping the jar file in both classes and lib, but I did not expect that to work, which it didn't. Rashmi Rubdi wrote: Hi Mike, On 5/1/07, Mike Peremsky wrote: > What do I need to do to get the class in the jar file to find the properties files external to it? To access a properties file that is external to the JAR file , add the full path of the Properties file's folder to the CLASSPATH. If you add the path of the Properties file to the CLASSPATH, there's no need to place the properties file under /WEB-INF/classes/ folder , it can be located anywhere you want. After setting the CLASSPATH, the properties file can be accessed simply by specifying its name. For example: If the mypropertiesfile.properties is placed under C:/dev/mypropertiesfile.properties set CLASSPATH=%CLASSPATH%;C:/dev/ public class TestPropertiesFile { public static void main(String[] args) { ResourceBundle props = ResourceBundle.getBundle("mypropertiesfile"); //String planet = (String) props.getObject("planet"); //System.out.println("Planet: " + planet); } } > TIA > > - Mike -Regards Rashmi --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org --------------------------------- Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos. --------------------------------- Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos. --0-1307972947-1178054615=:79209--