DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12759>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12759

Problem with HttpSession in load test

           Summary: Problem with HttpSession in load test
           Product: Tomcat 3
           Version: 3.3.1 Final
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Unknown
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Environment:
Platform = SUN
OS = Solaris
Apache 1.3.12
Tomcat 3.3.1
Connector = mod_jserv AJP12
SSL = mod_ssl + OpenSSL
Servlet 2.2 + JSP spec 1.1
Java Version 1.2 (Runtime & Dev)

The problem appears only with load tests.

It seems to have a confusion between the different sessions. To summarize, a 
sessionID corresponds to a login (that is to a user).
For example,  when a session is invalidated because the user sent a logout 
request, sometimes it occurs errors for an other user who is login yet and  has 
normally a different sessionID. In fact,  these two users have the same 
references to the session!!

Here is the POST method in the servlet:

                //Retrieve the HTTP session from the request
                HttpSession session = request.getSession();
                
                if (beanName.equals("loginBean") && httpMode.equals("secure"))
                {
                        //Invalidate current session
                        if (session.getAttribute("watchdog") == null)
                           session.setAttribute("watchdog", watchdog); //to 
                                                          clean some directories
                                                          related to the session
                        session.invalidate();
                        //Create new session
                        session = request.getSession(true);
                        
                        //Retrieve cookie from HTTP request
                        Cookie[] cookies = request.getCookies();
                        cookies[0].setValue(session.getId());
                        cookies[0].setSecure(true);
                        cookies[0].setPath(docRoot);
                        
                        //Add new cookie in HTTP response with secure option and 
                          new session ID
                        response.addCookie(cookies[0]);

                        //First abnormality
                        if (session.getAttribute("watchdog") != null)
                                Trace.println("[WMB_SERVLET]:   Watchdog already 
                                bound to the session?? ", "ERROR", traceLevel);
                }



Second abnormality:
Here is the exception displayed sometimes during load tests with moreover the 
trace above:

09/11 17:09:32:135  java.lang.IllegalStateException: getAttributeNames: Session 
already invalidated
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at java.lang.RuntimeException.<init>(RuntimeException.java:47)
        at java.lang.IllegalStateException.<init>(IllegalStateException.java:45)
        at org.apache.tomcat.facade.HttpSessionFacade.checkValid(Compiled Code)
        at org.apache.tomcat.facade.HttpSessionFacade.getAttribute(Compiled 
Code)
        at wmb.bean.protocole.Consult.serverProcess(Compiled Code)
        at wmb.servlet.WMBServlet.displayNextPage(Compiled Code)
        at wmb.servlet.WMBServlet.doGet(Compiled Code)
        at javax.servlet.http.HttpServlet.service(Compiled Code)
        at javax.servlet.http.HttpServlet.service(Compiled Code)
        at org.apache.tomcat.facade.ServletHandler.doService(Compiled Code)
        at org.apache.tomcat.core.Handler.invoke(Compiled Code)
        at org.apache.tomcat.core.Handler.service(Compiled Code)
        at org.apache.tomcat.facade.ServletHandler.service(Compiled Code)
        at org.apache.tomcat.facade.RequestDispatcherImpl.doForward(Compiled 
Code)
        at org.apache.tomcat.facade.RequestDispatcherImpl.forward(Compiled Code)
        at org.apache.jasper.runtime.PageContextImpl.forward(Compiled Code)
        at _default.fwd_consult_1._jspService(Compiled Code)
        at org.apache.jasper.runtime.HttpJspBase.service(Compiled Code)
        at javax.servlet.http.HttpServlet.service(Compiled Code)
        at org.apache.tomcat.facade.ServletHandler.doService(Compiled Code)
        at org.apache.tomcat.core.Handler.invoke(Compiled Code)
        at org.apache.tomcat.core.Handler.service(Compiled Code)
        at org.apache.tomcat.facade.ServletHandler.service(Compiled Code)
        at org.apache.tomcat.core.ContextManager.internalService(Compiled Code)
        at org.apache.tomcat.core.ContextManager.service(Compiled Code)
        at 
org.apache.tomcat.modules.server.Ajp12Interceptor.processConnection(Compiled 
Code)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Compiled Code)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Compiled Code)
        at java.lang.Thread.run(Compiled Code)



Here is javaBean Consult.java:

public void serverProcess()
        {
                if(reload)
                {
                    EmailParameters emailParameters = 
                       (EmailParameters)session.getAttribute("emailParameters");
                    …etc
                }
        }

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

Reply via email to