Solved

jsp session handling

Posted on 2003-12-11
4
30,799 Views
Last Modified: 2011-04-14
hello,
    I having lot of trouble login in at the same time. here is the scenario.
    When I login here is the flow of events
    Jsp---> sends commend to servlet --> calls Business Objects --> calls DAO's --> talks to the SSO and the local database for authentication..
   This is an J2EE application residing under ATG Dynamo server. But we are not using any of the ATG session handling.. We have our own session handling classes defined to manage sessions.
   Here is the problem.. Basically I noticed two problems.
 1)  When two Users tried to login at the same time. Only one user will able to login and the second user was shown the blank page with the message

java.lang.IllegalStateException: Redirect not allowed; response is already committed.
        at atg.servlet.DynamoHttpServletResponse.sendRedirect(DynamoHttpServletResponse.java:943)
        at com.attws.mms.TSDSecurity.controller.BaseController.dispatch(BaseController.java:397)
        at com.attws.mms.TSDSecurity.controller.BaseController.doPost(BaseController.java:502)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
                                                                 at com.attws.mms.TSDSecurity.controller.BaseController.service(BaseController.java:417)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                                                                 at atg.servlet.container.WebApplication.dispatchServlet(WebApplication.java:1188)
        at atg.servlet.container.WebApplication.dispatchServlet(WebApplication.java:1035)
        at atg.servlet.container.FilterChainImpl.dispatchServlet(FilterChainImpl.java:320)
        at atg.servlet.container.NullFilterChain.doFilter(NullFilterChain.java:116)
        at atg.servlet.container.FilterChainImpl.execute(FilterChainImpl.java:219)
        at atg.servlet.container.WebApplication.dispatchServlet(WebApplication.java:1007)
        at atg.servlet.container.WebApplication.dispatchRequest(WebApplication.java:642)
        at atg.servlet.container.WebApplication.dispatchRequest(WebApplication.java:503)
        at atg.servlet.pipeline.WebApplicationDispatcherPipelineServlet.service(WebApplicationDispatcherPipelineServlet.java:66)
                                                                                                                          at atg.servlet.pipeline.PipelineableServletImpl.
passRequest(PipelineableServletImpl.java:115)
        at atg.servlet.security.ThreadUserBinderServlet.service(ThreadUserBinderServlet.java:90)
        at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:115)
        at atg.servlet.security.FormLoginPipelineServlet.service(FormLoginPipelineServlet.java:156)
        at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:115)
        at atg.userprofiling.AccessControlServlet.service(AccessControlServlet.java:558)
        at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:115)
        at atg.userprofiling.PageEventTriggerPipelineServlet.service(PageEventTriggerPipelineServlet.java:168)

When you refresh the page you will be able to see the page comming

  2) We logged in as different users at the same time. A blank page with the above message comes up and then when I refresh for my wonder both of us are getting the same user info.. This does not happen always.. But still this happend couple of times. I know for sure this could be something to do with session handling. But I dont have any control on sessionManager class files.I dont know What I can do to handle this happening. Is there anything that I can try from JSP page like making sure we always have a unique session throughout the session? I'm using redirect everywhere... Please let me know if you need more information

Please help me out with the solution.
0
Comment
Question by:ragtan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 9

Accepted Solution

by:
vzilka earned 250 total points
ID: 9923683
It seems that you have a synchronization problem with your session handling.
1. Your JSP calls the same servlet instance somehow, or sends it an incorrect version of the request/response objects. Can you paste the JSP code?
2. Looks like the same problem as 1.
0
 
LVL 2

Expert Comment

by:anthony_castillon
ID: 9923695
On no. 1, the exception will occur if the response has already be flushed/sent prior to calling the sendRedirect().  If the session handling classes were done correctly, different threads should have been created to handle various sessions.  There shouldn't be any session issues there.  The problem then may be in your session handling mechanism.  Why not just use the built-in session handling mechanism of your server?  That's what these tools are for, so that you can do away with such tasks and instead concentrate with building your application.
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9925472
can we have a loot at this servlet in full: BaseController.java:397?
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 9926258
Does your Servlet, by any chance, implement the SingleThreadModel?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question