Hi Dan,
I followed your advise : I change Questionnaire so it is not serializable
and errors appeared in my page for this line :
item.add(new BoutonRemplirQuestionnaire("boutonQuestionnaire", new
Model<Questionnaire>(q)));
and it's coherent because it's when I click on this AjaxLink that I have the
first error (method *BoutonRemplirQuestionnaire* creates a Panel with an
AjaxLink inside).
But I don't really understand your solution :
> The best solution is to create an IModel for Questionnaire so that the
> entity itself is not serialized.
When I do this :
new Model<Questionnaire>(q)
it creates an IModel for Questionnaire, doesn't it?
and there is something else that I don't understand : why this problem
appears only when I add a HeaderContributor?
thanks for your help
M.
> Hi Mathilde,
>
> The story must be more complicated than your addition of a
> HeaderContributor. Somehow you're serializing a Questionnaire into your
> Wicket session, and when it's used in a subsequent request, the Hibernate
> session associated with its lazy collection of questions has been closed.
> One way to troubleshoot this is to change Questionnaire so it is not
> Serializable; then you will see the problem closer to its source. The best
> solution is to create an IModel for Questionnaire so that the entity itself
> is not serialized.
>
> Hope that helps, Dan
>
>
>