tomcat session - help pls urgent

Discussions

Web tier: servlets, JSP, Web frameworks: tomcat session - help pls urgent

  1. tomcat session - help pls urgent (3 messages)

    hi,
      im using tomcat 3.2.1(and 3.2.2)..Im not able to invalidate the existing session.

     for example

     if(!session.isNew()){
            
             session.invalidate();

     }


    i get the following error



    Internal Servlet Error:

    javax.servlet.ServletException: setAttribute: Session already invalidated
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
    at karthik._0002fkarthik_0002fpage_00031_0002ejsppage1_jsp_2._jspService(_0002fkarthik_0002fpage_00031_0002ejsppage1_jsp_2.java:129)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
    at org.apache.tomcat.core.Handler.service(Handler.java:287)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
    at java.lang.Thread.run(Thread.java:484)

    Root cause:
    java.lang.IllegalStateException: setAttribute: Session already invalidated
    at org.apache.tomcat.session.StandardSession.setAttribute(StandardSession.java:721)
    at karthik._0002fkarthik_0002fpage_00031_0002ejsppage1_jsp_2._jspService(_0002fkarthik_0002fpage_00031_0002ejsppage1_jsp_2.java:111)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
    at org.apache.tomcat.core.Handler.service(Handler.java:287)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
    at java.lang.Thread.run(Thread.java:484)



    please help me friends..

    karthik
  2. tomcat session - help pls urgent[ Go to top ]

    check you'r code... either there is no session for the user or you have invalidated the session already...the error you are getting, I suspect, is from the line session.isNew() and not form session.invalidate(), comment out session.invalidate() and see if you still get the exception...
  3. just call the session and then invalidate it eg
    HttpSession session = request.getSession(true);
    session.invalidate();
  4. so what is the solution[ Go to top ]

    In get request, I call a servlet , one to which i post data  String str3 =

    public String getAddRequests(HttpSession paramHttpSession, HttpServletResponse paramHttpServletResponse,....

    paramHttpSession.getAttribute("username").toString();

    The same code works n IE but fails in firefox

    Parvez Ahmad Hakim

    www.abobjects.com