[ 
https://issues.apache.org/jira/browse/WICKET-6845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17218195#comment-17218195
 ] 

Martin Tzvetanov Grigorov commented on WICKET-6845:
---------------------------------------------------

Hi Ernesto,

I am not sure what you mean. Where exactly do you think this check should be 
added ?

 

Here is how Java Serialization works:
 * Wicket's JavaSerializer calls ObjectOutputStream#write(page).
 * from here on Java Serialization related classes start writing all 
non-transient and non-static fields of the Page and the fields of inner 
components, etc.

Java Serialization usually is smart and does not write second time the same 
object instance but just uses a pointer to the already serialized data. But in 
the current case it was not able to detect this because we make a new call to 
JavaSerializer#serialize(Page) that uses a new ObjectOutputStream and all the 
caches and pointers are not known here.

 

> stackoverflow while serializing a page containing a reference to session
> ------------------------------------------------------------------------
>
>                 Key: WICKET-6845
>                 URL: https://issues.apache.org/jira/browse/WICKET-6845
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 9.0.0, 9.1.0
>            Reporter: Ernesto Reinaldo Barreiro
>            Assignee: Martin Tzvetanov Grigorov
>            Priority: Major
>         Attachments: session-serialization.tar.gz
>
>
> Something has changed in the way pages are serialized in wicket 9.x thus that 
> if a page has a reference to session serialization enters in a loop causing 
> an stack overflow. See attached  project. While there is no reasons to keep a 
> reference to session, and I have fixed that in our legacy code causing this 
> problem,  it would be nice to avoid server crashing because of this (and log 
> a huge warning for users to note).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to