tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Haraburda <da...@haraburda.com>
Subject Re: [DOC] Re: [3.2] JSP Compiling Classpath issues -- finding WEB-INF/class es
Date Fri, 20 Jul 2001 17:47:51 GMT
I don't think unsetting your CLASSPATH is necessary, especially since other
applications may rely on it.  I would guess that most problems occur when:

1) You add things you have in your WEB-INF/classes to your CLASSPATH (thus causing them
to be loaded by the system class loader, not the Tomcat web app class loader, which
causes problems)

or, as the case would appear to be with the POET sdk referred to before,

2) Your web application requires a certain JAR that you have placed in your WEB-INF/lib
directory, but unbeknownst to you, there is actually another JAR (perhaps an older
version of the software) sitting in your classpath, which gets loaded first.

Remember, a classloader always asks it's parent classloader to load a resource first,
and then only loads it itself if the parent cannot find it.

Just make sure things your web application requires are in your WEB-INF/libs directory,
and not in your classpath.

Craig McClanahan has two good posts about this:

http://mikal.org/interests/java/tomcat/archive/view?mesg=22444
http://mikal.org/interests/java/tomcat/archive/view?mesg=8512

As far as logging goes, you may want to check out the <Logger> elements is your
server.xml file. They provide a good way to keep your terminal un-cluttered. :-)

David

David Rees wrote:

> On Fri, Jul 20, 2001 at 06:22:21AM -0700, Rob S. wrote:
> > Ahhhh, maybe I should add this to the INSTALL.txt file - unset your
> > CLASSPATH before starting TC?  I've logged into my fair share of *nix boxes
> > where the admins have conveniently set a system-wide CLASSPATH containing an
> > XML parser, etc.
>
> I think it's the safe thing to do.  I think Tomcat 3.3 and Tomcat 4 both do this by
> default.  For Tomcat 3.2.X, I do this in custom startup scripts which make
> startup/shutdown a lot easier if you're maintaining multiple copies of Tomcat per
> host.  I also modify bin/tomcat.sh to redirect stdout/err to log files instead of
> cluttering the terminal.  If anyone is interested, I can send copies of the scripts
> and the patch to tomcat.sh...
>
> I would at least like to see the stdout/err patch integrated into Tomcat, I just
> don't know if there's much interest in including it into Tomcat 3.2.
>
> -Dave


Mime
View raw message