Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 71507 invoked from network); 27 Nov 2005 22:07:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Nov 2005 22:07:35 -0000 Received: (qmail 97873 invoked by uid 500); 27 Nov 2005 22:07:17 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 97820 invoked by uid 500); 27 Nov 2005 22:07:17 -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 97615 invoked by uid 99); 27 Nov 2005 22:07:16 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Nov 2005 14:07:16 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of wsmoak@gmail.com designates 64.233.184.192 as permitted sender) Received: from [64.233.184.192] (HELO wproxy.gmail.com) (64.233.184.192) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Nov 2005 14:08:47 -0800 Received: by wproxy.gmail.com with SMTP id i11so2041187wra for ; Sun, 27 Nov 2005 14:06:55 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JYjEdr0KF6GB4lb2+OApsTgEaiEi09nqOCjIv8kKT7vUBA9+iZI9JOTkxqgAGOkQCIOsj+SV63oO22gsvK3rZPQ2MPVmQ6oqdmjDdsL9yTuD0IeG6/fUhvvYZiT/66cyJNuzQsrPYLIXmd1JDS2nqRQg4YbLfyCtraw1/AmudbA= Received: by 10.54.131.17 with SMTP id e17mr6523025wrd; Sun, 27 Nov 2005 14:06:55 -0800 (PST) Received: by 10.54.128.14 with HTTP; Sun, 27 Nov 2005 14:06:55 -0800 (PST) Message-ID: Date: Sun, 27 Nov 2005 15:06:55 -0700 From: Wendy Smoak To: Tomcat Users List Subject: Re: reading file in ServletContextListener In-Reply-To: <15AE7684-4B4E-4442-8397-2F3C3E5F94D5@connecties.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <15AE7684-4B4E-4442-8397-2F3C3E5F94D5@connecties.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 11/27/05, Werner van Mook wrote: > In my class which implements ServletContextListener I try to read a > file. > it looks like : > parser.parse("friends.xml"); > > When I start tomcat 5.5.12 I get a FileNotFound Exception on the > friends.xml file. > > The file is in the root of my web-app. > I also tried "/friends.xml" but alas it did not work. Try using ServletContext's getResourceAsStream() method to find the file, assuming that you have a 'parse' method that will take an InputStream. -- Wendy --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org