tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: HttpServlet not found?
Date Tue, 29 Nov 2005 19:40:53 GMT
> From: Martin Gainty [mailto:mgainty@hotmail.com] 
> Subject: Re: HttpServlet not found?
> 
> (otherwise take servlet-api.jar off CLASSPATH and put back 
> j2ee.jar to $J2EE_HOME\lib\j2ee.jar and place on CLASSPATH)

I think you'll need to do more than that.  Tomcat has a variety of class
loaders, including one for each webapp, one for classes shared among all
webapps, and one for classes common to the webapps and Tomcat itself.
(This is in addition to the ones used by the JVM.)  See:
http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html
for details.  The picture there is quite illustrative.

This creates a tree of classloaders, and you will run into problems if
the same classes are present in more than one place along a particular
branch of the tree.  I've gotten burned too many times by the CLASSPATH
environment variable to use it anymore - I'd strongly suggest you delete
that variable and use explicit -cp settings where necessary.  This will
help to prevent any classes showing up under the wrong loader
inadvertently.

The gist of all this is that you don't want both j2ee.jar and
servlet-api.jar to be available to either your compilations or during
Tomcat execution.  It's possible that you might be able to replace
servlet-api.jar with j2ee.jar in Tomcat's common/lib, but I haven't
personally tried it.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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


Mime
View raw message