Help with sessions

View: New views
3 Messages — Rating Filter:   Alert me  

Help with sessions

by prquinlan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I know this must be a really stupid question but im going nuts trying to find out how to do this. I used to work with tomcat and to create  a session i simply did:

        HttpSession session = req.getSession(true);

Within jetty this doesnt work, i get an error about No SessionHandler or SessionManager.

Could someone either help, or point me in the right direction to some docs that explains how i go about creating one of those!


Re: Help with sessions

by David Yu-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Use the default settings of WebAppContext.(Default Constructor)
Its either you set the session handler to null.

Cheers

prquinlan wrote:

> I know this must be a really stupid question but im going nuts trying to find
> out how to do this. I used to work with tomcat and to create  a session i
> simply did:
>
>         HttpSession session = req.getSession(true);
>
> Within jetty this doesnt work, i get an error about No SessionHandler or
> SessionManager.
>
> Could someone either help, or point me in the right direction to some docs
> that explains how i go about creating one of those!
>
>
>  


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jetty-support mailing list
Jetty-support@...
https://lists.sourceforge.net/lists/listinfo/jetty-support

Re: Help with sessions

by javab0y :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I too am having the same problem with jetty-6.1.12.rc4.
I have Googled and found several references to this problem but no answers.

Stacktrace below:

java.lang.IllegalStateException: No SessionHandler or SessionManager
at org.mortbay.jetty.Request.getSession(Request.java:1123)
at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:227)
at au.com.gribbles.gateway.web.action.channel.ChannelControlProcessActionBean.preEdit(ChannelControlProcessActionBean.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.sourceforge.stripes.controller.DispatcherHelper$6.intercept(DispatcherHelper.java:410)
at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:157)
at net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:107)
at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:154)
at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:154)
at net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:73)
at net.sourceforge.stripes.controller.DispatcherHelper.invokeEventHandler(DispatcherHelper.java:408)
at net.sourceforge.stripes.controller.DispatcherServlet.invokeEventHandler(DispatcherServlet.java:241)
at net.sourceforge.stripes.controller.DispatcherServlet.doPost(DispatcherServlet.java:154)
at net.sourceforge.stripes.controller.DispatcherServlet.doGet(DispatcherServlet.java:61)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)


Also if I try to create a session at this point then I get the same issue as the original poster.

If I do other things in the web-app and come back to this page, then it seems to work fine.

SessionHandler/SessionManager have not been explicitly setup in the Jetty config file - so the default one should be used.... but it does not seem to be.

Any ideas?

prquinlan wrote:
I know this must be a really stupid question but im going nuts trying to find out how to do this. I used to work with tomcat and to create  a session i simply did:

        HttpSession session = req.getSession(true);

Within jetty this doesnt work, i get an error about No SessionHandler or SessionManager.

Could someone either help, or point me in the right direction to some docs that explains how i go about creating one of those!