tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: tomcat5 does not find properties file in webapp
Date Wed, 21 Jul 2004 14:06:32 GMT
In the case, I think you would need to say:
Thread.currentThread().getContextClassLoader().getResourceAsStream()

-Tim

Mike Curwen wrote:

> If MyServiceImpl.class was loaded by a common/lib classloader, would it be
> able to find resources in the WEB-INF/ classloader ?  (Do classloaders work
> that way?)
> 
> 
> 
> 
>>-----Original Message-----
>>From: Lorenz, Christoph [mailto:christoph.lorenz@friendscout24.de] 
>>Sent: Wednesday, July 21, 2004 8:15 AM
>>To: 'Tomcat Users List'
>>Subject: tomcat5 does not find properties file in webapp
>>
>>
>>Hi,
>>
>>what is the reason, that tomcat5 (5.0.25) does not read my 
>>properties file, which I placed in
>>
>>$WEBAPP/WEB-INF/classes/my.properties
>>
>>when I try to access it the following way:
>>
>>Properties p = new Properties(); 
>>p.load(MyServiceImpl.class.getResourceAsStream("/my.properties"));
>>
>>If I try to determing the position of the resource the following way:
>>
>>URL u = MyServiceImpl.class.getResource("/my.properties");
>>
>>u is null here. 
>>
>>Thank you very much in advance
>>  Christoph
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message