tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: CGI ...yeah, I know (Tomcat 4.1.29)
Date Tue, 09 Nov 2004 13:51:44 GMT

Hi,

>I still have one question though,
>
>How come when I copied the source from 4.1.31 directly into my own
class
>(with no dependencies) I got ClassNotFound exceptions and it would not
run

Was it really a CNFE or a NoClassDefFoundError?  

You have to be very careful with dependencies once you start putting
stuff in shared, common, and server classloader repositories.  That's
why I recommend never doing that, and just keeping everything in your
WEB-INF/lib directory.

The reason you must be very careful is that class com.foo loaded from
shared/lib is not the same as com.foo loaded from common/lib or
WEB-INF/lib.  A class is unique within its classloader, and these are
distinct classloaders.  This leads to problems with applications that
package classes such that some classes are in more than one repository,
or that require upwards (common/lib needing WEB-INF/lib for example)
repository lookups.  No-no.

Yoav



This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message