Re: Nial Darbey: ClassCast exception when invoking MySession.get() from Maven test phase
Igor,thanks for that. Yes, the solution was in passing the DummyApplication to the WicketTester constructor. Nial 2009/8/20 Igor Vaynberg > are you making wicket tester instantiate your own application class? > > -igor > > On Thu, Aug 20, 2009 at 3:09 AM, Nial Darbey wrote: > > 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-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Nial Darbey: ClassCast exception when invoking MySession.get() from Maven test phase
are you making wicket tester instantiate your own application class? -igor On Thu, Aug 20, 2009 at 3:09 AM, Nial Darbey wrote: > 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-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
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 : > 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-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Nial Darbey: ClassCast exception when invoking MySession.get() from Maven test phase
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