You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by bgooren <ba...@iswd.nl> on 2009/07/03 23:27:16 UTC

Re: Anybody know what is this situation?

I got the same error today, seems totally random.

The only possible explanation I have is that maybe the subclass (LoginPage$1
in your case) stores a PageHolder class instead of the actual page
(LoginPage) when serialized, and when LoginPage$1 is deserialized, the
PageHolder retrieves/points to a different Page.

I was just as baffled as you since in my case the two classes were totally
different, like in your case (com.application.MainPage vs
wicket.quickstart.LoginPage).
In my case it's two pages from the same application, but they are
functionally separate and never interact.

In my case I made the inner class that caused the problem a static inner
class. Since I have been unable to reproduce the problem I cannot confirm if
this resolves the problem.

Can you share what kind of class LoginPage$1 is? (it's the first anonymous
inner class in LoginPage) Is it a class which extends IModel?

Also, you someone from the Wicket team confirm if my explanation above is
possible at all (PageHolder retrieving a different class when
deserializing)?

Bas


MartinM wrote:
> 
> Anybody know what is this situation? Wicket 1.4-rc4
> 
> From production:
> 
> 2009-05-18 16:32:44,316 19598423 [btpool0-112] ERROR RequestCycle  -
> cannot assign instance of com.application.MainPage to field
> wicket.quickstart.LoginPage$1.this$0 of type
> wicket.quickstart.LoginPage in instance of
> wicket.quickstart.LoginPage$1
> java.lang.ClassCastException: cannot assign instance of
> com.application.MainPage to field wicket.quickstart.LoginPage$1.this$0
> of type wicket.quickstart.LoginPage in instance of
> wicket.quickstart.LoginPage$1
>        at
> java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2032)
>        at
> java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1212)
> 
> .. etc ...
> 

-- 
View this message in context: http://www.nabble.com/Anybody-know-what-is-this-situation--tp23597800p24329006.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Anybody know what is this situation?

Posted by Michał Letyński <ml...@consol.pl>.
I got the same error. It's also totally random. But i have a bit 
different situation.
In my page i have panel, inside this panel i got panel which is 
anonymous class and inside of this panel is InlineFrame with Page.
Any clues how to solve this ?


Jeremy Thomerson pisze:
> Generally unexplained class issues like this are because the same
> class gets loaded a second time from a different class loader.  I once
> had it throwing a ClassCastException that ClassA != ClassA.  Hard to
> track down, though.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Fri, Jul 3, 2009 at 4:27 PM, bgooren<ba...@iswd.nl> wrote:
>   
>> I got the same error today, seems totally random.
>>
>> The only possible explanation I have is that maybe the subclass (LoginPage$1
>> in your case) stores a PageHolder class instead of the actual page
>> (LoginPage) when serialized, and when LoginPage$1 is deserialized, the
>> PageHolder retrieves/points to a different Page.
>>
>> I was just as baffled as you since in my case the two classes were totally
>> different, like in your case (com.application.MainPage vs
>> wicket.quickstart.LoginPage).
>> In my case it's two pages from the same application, but they are
>> functionally separate and never interact.
>>
>> In my case I made the inner class that caused the problem a static inner
>> class. Since I have been unable to reproduce the problem I cannot confirm if
>> this resolves the problem.
>>
>> Can you share what kind of class LoginPage$1 is? (it's the first anonymous
>> inner class in LoginPage) Is it a class which extends IModel?
>>
>> Also, you someone from the Wicket team confirm if my explanation above is
>> possible at all (PageHolder retrieving a different class when
>> deserializing)?
>>
>> Bas
>>
>>
>> MartinM wrote:
>>     
>>> Anybody know what is this situation? Wicket 1.4-rc4
>>>
>>> From production:
>>>
>>> 2009-05-18 16:32:44,316 19598423 [btpool0-112] ERROR RequestCycle  -
>>> cannot assign instance of com.application.MainPage to field
>>> wicket.quickstart.LoginPage$1.this$0 of type
>>> wicket.quickstart.LoginPage in instance of
>>> wicket.quickstart.LoginPage$1
>>> java.lang.ClassCastException: cannot assign instance of
>>> com.application.MainPage to field wicket.quickstart.LoginPage$1.this$0
>>> of type wicket.quickstart.LoginPage in instance of
>>> wicket.quickstart.LoginPage$1
>>>        at
>>> java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2032)
>>>        at
>>> java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1212)
>>>
>>> .. etc ...
>>>
>>>       
>> --
>> View this message in context: http://www.nabble.com/Anybody-know-what-is-this-situation--tp23597800p24329006.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>   

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


Re: Anybody know what is this situation?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Generally unexplained class issues like this are because the same
class gets loaded a second time from a different class loader.  I once
had it throwing a ClassCastException that ClassA != ClassA.  Hard to
track down, though.

--
Jeremy Thomerson
http://www.wickettraining.com




On Fri, Jul 3, 2009 at 4:27 PM, bgooren<ba...@iswd.nl> wrote:
>
> I got the same error today, seems totally random.
>
> The only possible explanation I have is that maybe the subclass (LoginPage$1
> in your case) stores a PageHolder class instead of the actual page
> (LoginPage) when serialized, and when LoginPage$1 is deserialized, the
> PageHolder retrieves/points to a different Page.
>
> I was just as baffled as you since in my case the two classes were totally
> different, like in your case (com.application.MainPage vs
> wicket.quickstart.LoginPage).
> In my case it's two pages from the same application, but they are
> functionally separate and never interact.
>
> In my case I made the inner class that caused the problem a static inner
> class. Since I have been unable to reproduce the problem I cannot confirm if
> this resolves the problem.
>
> Can you share what kind of class LoginPage$1 is? (it's the first anonymous
> inner class in LoginPage) Is it a class which extends IModel?
>
> Also, you someone from the Wicket team confirm if my explanation above is
> possible at all (PageHolder retrieving a different class when
> deserializing)?
>
> Bas
>
>
> MartinM wrote:
>>
>> Anybody know what is this situation? Wicket 1.4-rc4
>>
>> From production:
>>
>> 2009-05-18 16:32:44,316 19598423 [btpool0-112] ERROR RequestCycle  -
>> cannot assign instance of com.application.MainPage to field
>> wicket.quickstart.LoginPage$1.this$0 of type
>> wicket.quickstart.LoginPage in instance of
>> wicket.quickstart.LoginPage$1
>> java.lang.ClassCastException: cannot assign instance of
>> com.application.MainPage to field wicket.quickstart.LoginPage$1.this$0
>> of type wicket.quickstart.LoginPage in instance of
>> wicket.quickstart.LoginPage$1
>>        at
>> java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2032)
>>        at
>> java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1212)
>>
>> .. etc ...
>>
>
> --
> View this message in context: http://www.nabble.com/Anybody-know-what-is-this-situation--tp23597800p24329006.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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