Perhaps a classloader issue? Check whether you have two Wicket versions in your project.

Sven

On 03/18/2012 10:56 PM, Pierre Goupil wrote:
Actually, this error occurs in my unit tests. I can't launch the app at
this very moment, because some more things need to be managed during the
migration. But this simple test should work as it all compiles.

As expected, the constructor from WebSession is called by
MyApplication#newSession(Request request, Response response)

Regards,

Pierre Goupil




On Sun, Mar 18, 2012 at 10:48 PM, Jeremy Thomerson<
[email protected]>  wrote:

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<[email protected]
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<
[email protected]>  wrote:

On Sun, Mar 18, 2012 at 5:08 PM, Pierre Goupil<[email protected]
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.





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to