You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Craig R. McClanahan" <cr...@apache.org> on 2001/12/07 20:10:53 UTC

Re: Modifying classpath for System Class Loader


On Fri, 7 Dec 2001, Karthi Ulaganathan wrote:

> Date: Fri, 7 Dec 2001 12:26:19 -0700
> From: Karthi Ulaganathan <ka...@hotmail.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Modifying classpath for System Class Loader
>
> For my servlet application I have to use some previously devloped code, that
> reads property files by using ClassLoader.getSystemResourceAsStream, which
> can not be changed.
>
> Since I have only bootstrap.jar in my classpath, the getSystemResource..
> always returns null. So I modifed CLASSPATH in Catalina.bat  and the
> registry parameter to include the property files path. This works fine for
> Nt Service and the starup.bat.
>
> But this way exposes my property files to all the web applications. Is there
> any other way
> to specify the property files in classpath so that
> ClassLoader.getSystemResource finds it.
>

By definition, the system classloader is exposed to all webapps.  If you
don't want these properties exposed to all web apps, then you *must*
change the code to use ClassLoader.getResourceAsStream() -- or some other
equivalent mechanism -- instead.

> Thanks,
> Karthi
>

Craig McClanahan


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>