User session getting mixed up on tomcat

前端 未结 1 1912
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-06 08:08

We are using Tomcat 6.29 behind IIS7.5, with spring, hibernate and struts2 framework. We are now beginning to notice that the server sessions are getting mixed up especially

1条回答
  •  渐次进展
    2020-12-06 09:09

    I've debugged something similar two days ago on a legacy project (not mine).

    It turned out it was custom Interceptors's fault.

    Check the custom Interceptors i can see in your stack,

            
            
    

    and ensure that their code is Thread Safe (avoid fields on interceptors instead of synchronize all your stuff, use only local variables).

    For example, consider the code:

    public abstract class ThreadUnsafeInterceptor extends AbstractInterceptor {
    
        private Map session; // 
         
     
    热议问题