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:[EMAIL PROTECTED] 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to