Atmosphere/atmosphere — Issue #45: jetty websocket request getSession() : java.lang.IllegalStateException: No SessionManager
Author: survivant
Created: 2011-10-25 12:54:18+00:00
State: open

if I use a block like that

if (supportSession()) {
// Create the session needed to support the Resume
// operation from disparate requests.
HttpSession session = req.getSession(true); // HERE
// Do not allow times out.
if (session.getMaxInactiveInterval() == DEFAULT_SESSION_TIMEOUT) {
session.setMaxInactiveInterval(-1);
}
}

or.. in the Handler

event.getRequest().getSession().getId() // will crash here.

java.lang.IllegalStateException: No SessionManager
at org.eclipse.jetty.server.Request.getSession(Request.java:1151) ~[na:na]
at org.eclipse.jetty.server.Request.getSession(Request.java:1130) ~[na:na]
at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:267) ~[servlet-api-3.0.jar:na]
at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:267) ~[servlet-api-3.0.jar:na]
at org.atmosphere.container.Servlet30CometSupport.action(Servlet30CometSupport.java:160) ~[atmosphere-runtime-0.8.0-RC2-SNAPSHOT.jar:0.8.0-RC2-SNAPSHOT]