tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony LaPaso" <>
Subject $CATALINA_HOME/shared/lib is *STILL* Ignored....
Date Thu, 04 Sep 2003 05:08:42 GMT
Hi all,

I posted a similar question a couple days ago but it seems the well-intended
responses I received were incorrect.

And let me first say that I have RTFMs -- more than once -- and this
*SHOULD* work, at least according to TFMs.

I'm using TC v5.0.9 on Linux with J2SE 1.4.2_01.

Very simply, I have a Jar with some custom classes in
$CATALINA_HOME/shared/lib/. These classes are not being found in my web
application. Instead, I get a NoClassDefFoundError. If I move the Jar to
$CATALINA_HOME/common/lib/, the classes are found with no problem.

Somebody, please, just do what I described above and tell me if you can get
classes to load from a jar in $CATALINA_HOME/shared/lib.

According to the Tomcat docs, Jar files in $CATALINA_HOME/shared/lib/
*SHOULD BE AVAILABLE* to a web app. See the TC documentation at:

I'm wondering if the TC docs are once again in error....

Thanks very much.....sincerely.


Finally, for the sake of completeness, I'd like to correct something someone
said in response to my previous post.

A NoClassDefFoundError does *NOT* mean the class was found. It means the
class was *NOT* found, as does ClassNotFoundException. The difference
between these two errors has to do with the mechanism by which the class
load operation was initiated.

ClassNotFoundException is thrown when a class cannot be found and the
programmer tried to load the class *explicitly* using Class.forName() or a
ClassLoader method. For example:
Class c = Class.forName("MyClass");

NoClassDefFoundError is thrown when a class cannot be found and the
programmer tried to load the class *implicitly* by referring to the class
name. For example:
MyClass x = new MyClass();

Both exceptions mean the class cannot be found. I am assuming that when
Tomcat throws one of these two errors it is following the usage guidelines
laid out in the javadocs for these errors.

View raw message