On Wed, 5 Sep 2001, Steve Hemminger wrote:

> Date: Wed, 5 Sep 2001 12:39:14 -0700
> From: Steve Hemminger <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Subject: Finding config files in Tomcat 4.0/Catalina
>
> What is the proper way to find configuration files in Tomcat 4.0?
>
> With Tomcat-3.x our server used java.lang.getResourceAsStream to retrieve
> the configuration files from any location defined in the CLASSPATH.  A
> common method was to put configuration files in $TOMCAT_HOME/classes.
>

I assume you really mean java.lang.ClassLoader.getResourceAsStream(),
right?

> This doesn't work on 4.0 for two reasons. First, it appears to reset the
> CLASSPATH when started,

That's true ... anything already on your CLASSPATH is totally ignored.
Having answered TOMCAT-USER questions for a couple of years, I've come to
the conclusion that class paths cause a very large percentage of the
total newbie startup problems (exceeded only by problems configuring the
Apache connector).  Once people understand how Tomcat 4 does things, these
questions and problems go away.

> second the default class loader behaviour seems to
> have changed.
>

If you want to be able to continue to use this call, simply put your
resources (unpacked) under $CATALINA_HOME/classes, or in JAR files under
$CATALINA_HOME/lib, or inside your webapp (under /WEB-INF/classes or in a
JAR file under /WEB-INF/lib).  All of these locations are automatically
made visible for resource loading, as well as class loading.

> Stephen Hemminger
> InterTrust Technologies
> (503)-889-1348
> [EMAIL PROTECTED]
>
>

Craig


Reply via email to