You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Witold Czaplewski <wi...@cts-media.eu> on 2009/08/20 12:17:10 UTC

Re: Nial Darbey: ClassCast exception when invoking MySession.get() from Maven test phase

Try

    public static MyWebSession get() {
        return (MyWebSession) WebSession.get();
    }

Witold

Am Thu, 20 Aug 2009 12:09:00 +0200
schrieb Nial Darbey <ni...@gmail.com>:

> Hi everyone,I have subclassed the WebSession class as recommended in
> Wicket in Action and I override the public static get() method to
> return Session.get() cast to MyWebSession as follows:
> public static MyWebSession get() { return (MyWebSession)
> Session.get(); }
> 
> This of course works as expected but when I run my tests from maven
> against code which uses this I get a ClassCastException
> (org.apache.wicket.protocol.http.WebSession cannot be cast to
> org.my.MyWebSession)
> I'm guessing this must be a classloader issue.
> Has anyone come across this?
> Best regards,
> Nial Darbey


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org