Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 8215 invoked from network); 7 Apr 2004 12:50:06 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 7 Apr 2004 12:50:06 -0000 Received: (qmail 78095 invoked by uid 500); 7 Apr 2004 12:49:51 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 78052 invoked by uid 500); 7 Apr 2004 12:49:51 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 78035 invoked from network); 7 Apr 2004 12:49:51 -0000 Received: from unknown (HELO smtp2.toyota-europe.com) (62.72.98.231) by daedalus.apache.org with SMTP; 7 Apr 2004 12:49:51 -0000 Received: (qmail 5490 invoked from network); 7 Apr 2004 15:44:21 -0000 Received: from unknown (HELO smtp2.toyota-europe.com) (127.0.0.1) by a with SMTP; 7 Apr 2004 15:44:21 -0000 Received: (qmail 5485 invoked from network); 7 Apr 2004 15:44:21 -0000 Received: from unknown (HELO tmmebxlxnts04.be.tmme.com) (150.45.94.4) by 0 with SMTP; 7 Apr 2004 15:44:21 -0000 Subject: Re: Problem loading properties file using the CLASSPATH To: "Ant Users List" X-Mailer: Lotus Notes Release 5.0.8 June 18, 2001 Message-ID: From: Walter.Heestermans@toyota-europe.com Date: Wed, 7 Apr 2004 14:51:33 +0200 X-MIMETrack: Serialize by Router on BXLNOTES04/TMME(Release 5.0.8 |June 18, 2001) at 07/04/2004 14:49:51 MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I replace my code by getClass().getClassLoader().getResourceAsStream(...) and It works fine now in ANT 1.6.1 Walter To: user@ant.apache.org cc: bcc: Subject: Re: Problem loading properties file using the CLASSPATH Stefan Bodewig 07/04/2004 14:23 On Wed, 7 Apr 2004, Walter Heestermans wrote: > InputStream in = > ClassLoader.getSystemClassLoader().getResourceAsStream > ("TheProperties.properties"); > > The location of the properties file is searched using the CLASSPATH. > > This works fine in ANT version 1.5.4, but not anymore in ANT version > 1.6.1. Probably related to the new classloader implementation. How > can I solve this issue? Where exactly is your resource? Inside a jar that lives in ANT_HOME/lib, I assume. The content of ANT_HOME/lib has been on the system CLASSPATH in Ant 1.5.x but no longer is in Ant 1.6.x. Use getClass().getClassLoader().getResourceAsStream(...) instead, this will look up the resource in the same classloader that has loaded your class. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org