On Sun, 16 Sep 2001, Jiger Java wrote:

> Date: Sun, 16 Sep 2001 12:14:11 +0530
> From: Jiger Java <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Tomcat 4 RC 2 doubts
>
> Hi friends,
>            This is my first mail to such a wondefull group.Well I just
> downloaded Tomcat Rc2 (and tried to convince my boss to use it).
> But frankly speaking I found some weird diffiulty installing Rc1 & Rc2.
> Now I understand that Tomcat 4 has a major architecture changes like
> Custom Classloaders & places to store jar files etc.
> But I have some queries hope I will be guided properly.
> Doubt No.
> 1. Since Tomcat 4 uses its own Classloaders it does not recognise the JDK
> CLASSPATH variable.Now what do I do if I want a set of libraries which I
> have installed in JDK(set in CLASSPATH variable) & also to be used by
> tomcat. Putting things in two places wold be cumbersome.Dont youall feel so.

One approach would be to put them where Tomcat needs them (in the "lib"
directory) and adjust your CLASSPATH environment variable to point there.
Then, the JAR files are still in only one place.

Tomcat 3.2 is the last version of Tomcat that supported using the system
CLASSPATH to make libraries available to web apps.  Throughout it's
history, this "feature" has caused a very significant percentage of user
problems and questions on this mailing list (second only to configuing
Tomcat to work with Apache).  With the banishment of the system class
path, this kind of problem has gone to zero -- once you understand the new
policy, it is so simple that nobody makes mistakes with it.  Suffice it to
say that I will *strongly* resist any efforts to make Tomcat 4 import the
system classpath again (of course, you can always modify your own copy of
the "catalina.bat" or "catalina.sh" scripts, but you're on your own to
solve the problems that you are bound to create for yourself).

By the way, if you use Ant to build or run your projects, you don't *ever*
have to worry about classpaths at all -- simply let Ant build them for you
on the fly.  An example of this (for developers of web apps) is documented
in the Application Developer's Guide that is included with Tomcat, and
available online at:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/

> 2. If I try to add CLASSPATH in the catalina.bat file along with its
> CLASSPATH then TOmcat starts giving out strange errors. For e.g In my app I
> was using Custom Tags & appending the classpath in catalina gave me
> NoClassDefFound for TagSupport class of JSP when the Sample Custom Tag
> example worked normally. How do I integrate JDK classpath with Tomcat
> CLASSPATH without any hitches.

Thank you for proving my point -- it is *way* too easy to cause problems
using CLASSPATH :-).

> 3. I am believing that Tomcat no longer allows extraced classes in the lib
> dir. only .jars are allowed & all non-jars libraries should be kept in
> classes dir. but this is very non-intutive coz it confuses us with servlets
> & libraries. Should the pre-Tomcat 4 standard of keeping non-jars in lib &
> then brought into CLASSPATH in tomcat.bat/catalina.bat work. Any specific
> reasons.
>

If you want to use unpacked classes, but make them available to all web
apps, create a "classes" directory under the top-level Tomcat directory,
and put them there (nested in package directories if needed).  The use of
"classes" and "lib" at the global level is exactly like the use of
"/WEB-INF/classes" and "/WEB-INF/lib" inside your web app to allow either
unpacked classes or JAR files.

> THere are many more doubts guys but please enlighten me with these atleast.
>
> Keep up the good work.
> Thanks,
> Jiger
>

Craig McClanahan

Reply via email to