tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Sand" <rs...@vgalleries.com>
Subject Re: getResourceAsStream doesn't find files in WEB-INF/classes
Date Mon, 25 Jun 2001 12:12:13 GMT
What is interesting is that if I move the properties files out of the
/WEB-INF/classes directory and into another separate directory that is
explicitly set in my classpath, then it works.  But I know that the /WEB-INF
directory is working (i.e. it is a context for "/") because my web.xml
settings are working fine.

Best regards,

Richard

----- Original Message -----
From: <lists@cglis.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Friday, June 22, 2001 3:22 PM
Subject: Re: getResourceAsStream doesn't find files in WEB-INF/classes


>
> Try removing the beginning "/". ie
getClass().getResourceAsStream("app.properties");
>
> Christopher Lambrou,
> CGL Computer Services, Inc.
> Empire State Building,
> PMB 16J Suite 3304
> New York, NY 10118
> Tel: (212) 971-9723
> Fax: (212) 564-1135
> URL: http://www.cglcomputer.com
> Email: chris.lambrou@cglcomputer.com
>
> On 6/22/2001 14:37:38, you said:
> >Hi- I've deployed an application with Tomcat at the root (i.e. "/").  At
one
> >point I load a resource file with the command:
> >
> >InputStream is = getClass().getResourceAsStream("/app.properties");
> >
> >But Tomcat throws an exception here if the file app.properties is in the
> >/WEB-INF/classes directory.  If I copy it into a directory that is in the
> >default CLASSPATH, then it works fine.  Isn't the WEB-INF/classes
directory
> >for each deployed application automatically added to the Tomcat
classpath?
> >Is the behavior I'm seeing the expected behavior?
> >
> >I hope I'm just doing something thick... otherwise, its more problematic
to
> >be able to bundle up an application, because the resource files would
need
> >to be copied somewhere else.  Any advice?
> >
> >BTW Tomcat 3.2.2 on Win2k, no web server (i.e. Tomcat default, port
8080).
> >
> >Thanks!
> >
> >-Richard
> >
> >
>
>


Mime
View raw message