You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Wells Tiedeman <JW...@youcentric.com> on 2001/07/17 22:06:10 UTC

RE: The 4.0b5 doesn't recognize a servlet class

Any of the jars/classes containing the packages java.*, com.sun.*, javax.*,
etc.  If any of these are included in your /WEB-INF/lib directory the class
loaders get confused.
 
-Wells

-----Original Message-----
From: Vernon Wu [mailto:vwu0@hotmail.com]
Sent: Tuesday, July 17, 2001 3:49 PM
To: tomcat-user@jakarta.apache.org
Subject: The 4.0b5 doesn't recognize a servlet class







Hi, Wells,

 

Thanks for your response. 

 

It took me awhile trying to figure how the CLASSPATH relates with the
problem. I build up the JSP application using Tomcat 3.x with the standard
procedure. Nothing inside the project is set up in the CLASSPATH. I don't
know what you means by "all j2ee platform classes". Are the classes used
j2ee APIs?

 

Thx.

 

Vernon



----Original Message Follows---- 
From: Wells Tiedeman 
Reply-To: tomcat-user@jakarta.apache.org 
To: "'tomcat-user@jakarta.apache.org'" 
Subject: RE: ServletException in 4.0b5 
Date: Tue, 17 Jul 2001 08:46:44 -0400 
MIME-Version: 1.0 
Received: from [64.208.42.41] by hotmail.com (3.2) with ESMTP id
MHotMailBD1D7FCF00164004376140D02A290F500; Tue, 17 Jul 2001 05:51:28 -0700 
Received: (qmail 73852 invoked by uid 500); 17 Jul 2001 12:51:21 -0000 
Received: (qmail 73845 invoked from network); 17 Jul 2001 12:51:21 -0000 
Received: from salesvision-gw.youcentric.com (HELO
yc?exchange.yc?exchange.salesvision.com) (12.19.52.2) by h31.sny.collab.net
with SMTP; 17 Jul 2001 12:51:21 -0000 
Received: by yc_exchange.yc_exchange.salesvision.com with Internet Mail
Service (5.5.2653.19)id <3XZSJV86>; Tue, 17 Jul 2001 08:46:45 -0400 
>From tomcat-user-return-41367-vwu0 Tue, 17 Jul 2001 05:52:26 -0700 
Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm 
Precedence: bulk 
list-help: 
list-unsubscribe: 
list-post: 
Delivered-To: mailing list tomcat-user@jakarta.apache.org 
Message-ID:
<15082D39DCA99746A53E37B280DCB10AC04C06@yc_exchange.yc_exchange.salesvision.
com> 
X-Mailer: Internet Mail Service (5.5.2653.19) 
X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N 
I experienced the same problem. It's due to a class loader issue. Multiple 
class loaders have been introduced in V4.0 to implement the requirements 
found in Section 9.6.2 of the Servlet 2.3 Spec. These class loaders are 
used to load all of the jars and classes rather than using the CLASSPATH. 
I was able to resolve this problem as follows : 
- Add all supporting jars for your web application (except J2EE jars) to 
the /WEB-INF/lib directory rather than including them in the CLASSPATH 
- Add all of the required classes for your web application to the 
/WEB-INF/classes directory rather than including them in the CLASSPATH 
- Add the j2ee.jar from the /j2sdkee1.3/lib directory to the 
TOMCAT_HOME/common/lib directory. All J2EE platform classes must be placed 
in the common/lib or common/classes directories rather than with the web 
application. 
-Wells 
Wells Tiedeman 
YOUcentric, Inc. 
P: 704.401.1109 
F: 704.401.1240 
jwtiedeman@youcentric.com 
For more information on YOUcentric, please visit our web site at 
www.youcentric.com 
-----Original Message----- 
From: Vernon Wu [mailto:vwu0@hotmail.com] 
Sent: Monday, July 16, 2001 7:53 PM 
To: tomcat-user@jakarta.apache.org 
Subject: ServletException in 4.0b5 
I move one our small JSP application from 3.x to 4.0b5 for the reason of 
using servlet 2.3 specification: ServletContextListener, HttpSessionListener

be more specific. 
I get the exception under the 4.0b5 with the following messages: 
Exception Report: 
javax.servlet.ServletException: Class abc.control.ControllerServlet is not a

Servlet 
.... 
Root Cause: 
java.lang.ClassCastException: abc.control.ControllerServlet 
... 
There is not any indication that anywhere my code is not approprt. What I 
shall do at this situation? 
I believe that I encounter the similar situation in the 3.x, and it can be 
resolved by recycle the Tomcat server. That method doesn't work for 4.0b5. 
Thanks. 
Vernon 
_____ 
Get your FREE download of MSN Explorer at http://explorer.msn.com 

  _____  

Get your FREE download of MSN Explorer at http://explorer.msn.com
<http://explorer.msn.com>