tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Lucia" <timlu...@yahoo.com>
Subject RE: Strange servlet exception
Date Tue, 21 Feb 2006 16:02:09 GMT
You cannot ship servlet-api.jar as part of your war.  If you do, you will
have two different instances of the HttpSession.class object -- one loaded
via Tomcat (from common/lib/servlet-api.jar) and the other loaded from the
one in your .war.

So, put it on your compile-time classpath, but do not include it in your
.war.

Tim
 

-----Original Message-----
From: Artur Rataj [mailto:arturrataj@gmail.com] 
Sent: Tuesday, February 21, 2006 10:57 AM
To: users@tomcat.apache.org
Subject: Strange servlet exception

Hello!

I am developing a web app inside netbeans, and it worked until the following
servlet exception began to appear:

 javax.servlet.ServletException: Servlet execution threw an exception

root cause

java.lang.NoClassDefFoundError: javax/servlet/http/HttpSession
	org.algstoch.httpuserlib.Password.removeUserId(Password.java:118)
	
servlets.LoginScreenServlet.processRequest(LoginScreenServlet.java:31)
	servlets.LoginScreenServlet.doGet(LoginScreenServlet.java:108)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

The platform is Java 1.6.0b2, tomcat 5.5.13. The methods pass HttpSession
object until some method tries to call session.removeAttribute(), what
throws the NoClassDefFoundException.
The class is inside servlet-api.jar in tomcat, and inside the war because
some library needs it to compile within netbeans, and netbeans propagates
compile-time libraries to all categories.

What can be the reason of it?

Thanks,
Artur

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



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


Mime
View raw message