title: IllegalStateException from SRTServletResponse (com.ibm:jaxws.thinclient 8.5) - websphere with spring and SSO configuration
body: <p>during configuration SSO on websphere, I encountered strange issue. It does not interfere working of application (or I don't know about interference) but this error appears in logs</p>
  
  <p>log:</p>
  
  <pre><code> 2019-12-06 14:18:03,754 ERROR DbLogEntryDao                  - com.somecompany.product.web.system.exception.BasicHandlerExceptionResolver.resolveException (location: BasicHandlerExceptionResolver.java:65) Unexpected error at server SRPZZAPP0392.INSIM.BIZ: [java.lang.IllegalStateException [1575638283660] :null]
   2019-12-06 14:18:03,754 ERROR BasicHandlerExceptionResolver  - Unexpected error
   java.lang.IllegalStateException
       at com.ibm.ws.webcontainer.srt.SRTServletResponse.addSessionCookie(SRTServletResponse.java:2177)
       at com.ibm.ws.session.SessionAffinityManager.setCookie(SessionAffinityManager.java:589)
       at com.ibm.ws.session.SessionManager.adaptAndSetCookie(SessionManager.java:750)
       at com.ibm.ws.session.SessionManager.createSession(SessionManager.java:737)
       at com.ibm.ws.session.SessionContext.getIHttpSession(SessionContext.java:505)
       at com.ibm.ws.session.SessionContext.getIHttpSession(SessionContext.java:426)
       at com.ibm.ws.webcontainer.srt.SRTRequestContext.getSession(SRTRequestContext.java:113)
       at com.ibm.ws.webcontainer.srt.SRTServletRequest.getSession(SRTServletRequest.java:2212)
       at com.ibm.ws.webcontainer.srt.SRTServletRequest.getSession(SRTServletRequest.java:2196)
       at com.somecompany.product.web.utils.ContextHelper.getUserId(ContextHelper.java:178)
       at com.somecompany.product.web.utils.ContextHelper.getUser(ContextHelper.java:182)
       at com.somecompany.product.web.system.interceptors.SsoInterceptor.preHandle(SsoInterceptor.java:55)
       at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:865)
       at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
       at com.somecompany.product.web.spring.productDispatcherServlet.doService(productDispatcherServlet.java:28)
       at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
       at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
       at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1233)
       at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:782)
       at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
       at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
       at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
       at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:79)
       at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:967)
       at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107)
       at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1404)
       at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:551)
       at com.ibm.ws.webcontainer.webapp.WebApp.sendError(WebApp.java:3496)
       at com.ibm.wsspi.webcontainer.collaborator.CollaboratorHelper.processSecurityPreInvokeException(CollaboratorHelper.java:145)
  </code></pre>
  
  <p>ContextHelper.getUserId(ContextHelper.java:178) code:</p>
  
  <pre><code>public static Long getUserId(HttpServletRequest request) {
   return (Long) request.getSession().getAttribute(SessionAttribute.USER);
  }
  </code></pre>
  
  <p>did someone have to face similar problem? </p>