Ok turns out this morning when I restarted the server, it started working.
The things I had changed was the return type for newSession in
WebApplication to be NeobitsWebSession and return type of the following
covariant method also to be NeobitsWebSession. I suppose thats how it
supposed to be - can someone confirm? also not sure why it was only throwing
exception during back button and not during normal browsing of the site in
forward direction.
I think the reason why this change didnt work yesterday was probably because
of the serialization, for some reason the serialization doesnt seem to
detect the new version of the class a lot of the times and I have to either
delete the session.ser file under tomcat or restart the tomcat server from
scratch to make it see the new classes.
igor.vaynberg wrote:
>
> public static NeobitsWebSession get()
> {
> Class clazz=Session.get();
> System.out.println(clazz.getName());
> return (NeobitsWebSession)Session.get();
> }
>
> what does that print?
>
> -igor
>
> On Fri, Jul 25, 2008 at 10:00 AM, Ritz123 <[EMAIL PROTECTED]>
> wrote:
>>
>> Igor,
>>
>> I have posted the relevant code in the other reply to Tim. If you mean
>> actual class being returned from the covariant get() method - I tried
>> returning both Session and NeobitsWebSession (my custom websession
>> class).
>> But still get the same error.
>>
>>
>>
>> igor.vaynberg wrote:
>>>
>>> and so what is the actual class being returned?
>>>
>>> -igor
>>>
>>> On Thu, Jul 24, 2008 at 7:21 PM, Ritz123 <[EMAIL PROTECTED]>
>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I have a custom Session object which is registered in the custom
>>>> WebApplication class as newSession method override.
>>>>
>>>> The session object overrides static Session.get() method returning
>>>> custom
>>>> instance (covariant). The problem is, for some reason when I hit back
>>>> button
>>>> in the browser I get ClassCastException on session (see below)
>>>>
>>>>
>>>> Root cause:
>>>>
>>>> java.lang.ClassCastException: com.neobits.web.NeobitsWebSession
>>>> at com.neobits.web.NeobitsWebSession.get(NeobitsWebSession.java:51)
>>>> at
>>>> com.neobits.web.pages.ViewCartPage$CartDetailsFragment$CheckoutButton.onSubmit(ViewCartPage.java:330)
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Session.get-covariant-override-and-back-button-issue--tp18644053p18644053.html
>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Session.get-covariant-override-and-back-button-issue--tp18644053p18655735.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Session.get-covariant-override-and-back-button-issue--tp18644053p18657342.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]