Put a breakpoint in the WebSession constructor and see where it's getting
called.

Or, perhaps you won't see anything there if this is happening because you
are in a serialized WebSession.  You can test that by clearing all cookies,
etc, and starting a new session.

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

On Sun, Mar 18, 2012 at 5:40 PM, Pierre Goupil <goupilpie...@gmail.com>wrote:

> Yes, absolutely:
>
>
>    public Session newSession(final Request request, final Response
> response)
>    {
>        return new MySession(request);
>     }
>
>
>
>
> On Sun, Mar 18, 2012 at 10:32 PM, Jeremy Thomerson <
> jer...@wickettraining.com> wrote:
>
> > On Sun, Mar 18, 2012 at 5:08 PM, Pierre Goupil <goupilpie...@gmail.com
> > >wrote:
> >
> > > Good evening,
> > >
> > > I'm currently in the process of migrating my app from Wicket 1.4 to
> > Wicket
> > > 1.5. I've read the migration guide and everything seems to go fine,
> > except
> > > for session management.
> > >
> > > Here's my code:
> > >
> > > public class MySession extends WebSession
> > > {
> > >
> > >  public static MySession get()
> > >    {
> > >        return (MySession)Session.get();
> > >    }
> > >
> > > }
> > >
> > > When call, the get() method gives this stacktrace:
> > >
> > > Caused by: java.lang.ClassCastException:
> > > org.apache.wicket.protocol.http.WebSession cannot be cast to MySession
> > >
> > > Any help, please?
> > >
> > > Regards,
> > >
> > > Pierre Goupil
> > >
> >
> >
> > Does your application override newSession and return a new MySession?
> >
> > --
> > Jeremy Thomerson
> > http://wickettraining.com
> > *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
> >
>
>
>
> --
> Si tu penses que la violence ne résout rien, c'est que tu n'as pas tapé
> assez fort.
>

Reply via email to