I've came across this kind of problem when I was migrating my application on
the Wicket 1.3. In my case, the problem seemed to be caused by incorrect
usage of public PageLink ( String id, Page page ) constructor, where I have
been creating a new instance of target page (the usual newbie problem).
Since both the original page and the target page were inheriting from the
same page, I was suspecting that there was some circularity in the
serialization process.

However, replacing "bad" constructor with IPageLink version solved the
problem, and I have not investigated it further.

Robert Novotny


Jonathan Locke wrote:
> 
> 
> Don't know enough about serialization to know what the solution is, but
> this code
> could definitely be more defensive or more correct.  If writeReplace is
> called on a 
> page that is already being serialized either it's an error and an
> exception should be 
> thrown to alert an internal error is in progress OR writeReplace is
> supposed to be 
> called because some component nested on the page is referencing the page
> and 
> the writeReplace method needs to be smart enough to handle that case by
> writing 
> out a reference to something in the stream instead of trying to serialize
> the whole 
> page over again.  If it's the first thing, we should add the defensive
> check on that
> thread local serializer so that it will only serialize if it's not already
> serializing BEFORE
> we fix any underlying problem.  If it's the second thing, I have no idea
> what to do.
> 
> 
> Jonathan Locke wrote:
>> 
>> 
>> So that Page.writeReplace call is getting called recursively.  Maybe
>> what's happening
>> is that serialization is discovering a self-ref to the Page somewhere? 
>> Then it calls in
>> to writeReplace even though the page is already being serialized.
>> 
>> 
>> Jonathan Locke wrote:
>>> 
>>> Anyone run into this yet?
>>> 
>>> Exception in thread "FilePageSerializingThread-thoof"
>>> java.lang.StackOverflowError
>>>     at
>>> java.io.ObjectOutputStream$HandleTable.hash(ObjectOutputStream.java:2313)
>>>          ....
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Stack-overflow-in-FilePageSerializingThread-tf3761089.html#a10633727
Sent from the Wicket - Dev mailing list archive at Nabble.com.

Reply via email to