Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 21344 invoked from network); 3 Mar 2006 05:31:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Mar 2006 05:31:53 -0000 Received: (qmail 38397 invoked by uid 500); 3 Mar 2006 05:32:38 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 38029 invoked by uid 500); 3 Mar 2006 05:32:36 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 38018 invoked by uid 99); 3 Mar 2006 05:32:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Mar 2006 21:32:36 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=BIZ_TLD,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of anthony.bin.hong@gmail.com designates 66.249.82.207 as permitted sender) Received: from [66.249.82.207] (HELO xproxy.gmail.com) (66.249.82.207) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Mar 2006 21:32:35 -0800 Received: by xproxy.gmail.com with SMTP id s11so394900wxc for ; Thu, 02 Mar 2006 21:32:14 -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=PY72yW6XqyFXKdABqNuXDwT/1xypjSI0qHZuSReWeFfBHx+rlgMCO8WW7q12DgRDPDlEsySAulmMOQuXfhHNpctMfVk45wlb52XXEOiHElPwjfh2Ookyg0W4tV+fa3y9KffxTAmpp1Y73rJUC3tpvV3xqsFy50/I/9Cb7YtlO44= Received: by 10.70.59.16 with SMTP id h16mr4350620wxa; Thu, 02 Mar 2006 21:32:14 -0800 (PST) Received: by 10.70.63.20 with HTTP; Thu, 2 Mar 2006 21:32:14 -0800 (PST) Message-ID: <86de4f4d0603022132i74ceb2eo4999c46241161d3a@mail.gmail.com> Date: Fri, 3 Mar 2006 13:32:14 +0800 From: "Anthony Hong" To: "MyFaces Discussion" Subject: Re: getResource giving filenotfound In-Reply-To: <4407BF98.7040205@plauditdesign.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <4407BF98.7040205@plauditdesign.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N String filePath =3D ((ServletContext)FacesContext.getCurrentInstance().getExternalContext().get= Context()).getRealPath("/WEB-INF/test.properties"); You can get correct file path. On 3/3/06, David Schlotfeldt wrote: > I have a property file in WEB-INF. I thought this is how you get to it: > > URL configUrl =3D > FacesContext.getCurrentInstance().getExternalContext().getResource("/WEB-= INF/test.properties"); > ... > configProperties.load(new FileInputStream(file)); > > > But I get this exception > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > Caused by: java.io.FileNotFoundException: > jndi:\localhost\test.biz\WEB-INF\test.properties (The filename, > directory name, or volume label syntax is incorrect) > at java.io.FileInputStream.open(Native Method) > at java.io.FileInputStream.(FileInputStream.java:106) > at biz.test.site.TestFacade.(TestFacade.java:129) > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAc= cessorImpl.java:39) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConst= ructorAccessorImpl.java:27) > at java.lang.reflect.Constructor.newInstance(Constructor.java:494) > at java.lang.Class.newInstance0(Class.java:350) > at java.lang.Class.newInstance(Class.java:303) > at > org.apache.myfaces.shared_impl.util.ClassUtils.newInstance(ClassUtils.jav= a:274) > at > org.apache.myfaces.shared_impl.util.ClassUtils.newInstance(ClassUtils.jav= a:265) > at > org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBean= Builder.java:50) > at > org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolv= erImpl.java:311) > at > org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(Las= tVariableResolverInChain.java:42) > at > com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELCon= text.java:134) > at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:44) > at com.sun.el.parser.AstValue.getValue(AstValue.java:85) > at > com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:183) > at > com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:7= 1) > at > com.sun.facelets.tag.TagAttribute.getObject(TagAttribute.java:233) > ... 39 more > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D > > Why is it looking in jndi? > What am I doing wrong? > > Thanks, > David > > > -- Anthony Hong