You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniele IPPOLITI <da...@amadeus.com> on 2016/03/09 17:30:50 UTC

Issue with serialization of a page

Hello,
I would like to write you because I'm migrating since wicket 1.4.X to wicket 7.X, but I'm facing a problem that I was not facing before:

In the onSubmit of AdvancedSearchForm, the class set the next page creating MultiAvailResultPage

[cid:image008.png@01D17A02.6618F550]

In the initiate of MultiAvailResultPage we have used a Future variable

[cid:image003.png@01D1795F.2E170690]

When we need to show the page to the user we call:

[cid:image008.png@01D1795F.F6656830]
But this time future is not any more containing the original value but is null!!! This because the variable is declared transient and we passed through a serialization that apparently before we were not. Do you have explanations to that? Maybe something changed between the old version? Idea on how to solve it? (even creating a detachable model it seems not solving the issue because the Future variable doesn't have any id that I can keep to retrieve it after the serialization.

The two classes are attached to the mail if you need to have a deeper look.
Your help it will be really appreciated.
Kind regards,
___________________________
Daniele Ippoliti
Software Engineer, PMP (r)
R&D-NBU-AHP-HDI-BWS-HBK
Amadeus SAS
Phone: +33 (0) 4 97042180
daniele.ippoliti@amadeus.com<ma...@amadeus.com>
[Description: cid:image001.png@01D05671.86C8BCA0]<http://www.amadeus.com/>


Re: Issue with serialization of a page

Posted by Sven Meier <sv...@meiers.net>.
Hi,

a Wicket page has to be serializable, this includes all references to 
other objects held as members.

Your IbeThreadPool should keep a map of futures, and #submit() should 
return an identifier.
With this identifier you can retrieve the future from the thread pool 
once you need it.

Hope this helps
Sven


On 09.03.2016 17:30, Daniele IPPOLITI wrote:
>
> Hello,
>
> I would like to write you because I’m migrating since wicket 1.4.X to 
> wicket 7.X, but I’m facing a problem that I was not facing before:
>
> In the onSubmit of AdvancedSearchForm, the class set the next page 
> creating MultiAvailResultPage
>
> In the initiate of MultiAvailResultPage we have used a Future variable
>
> cid:image003.png@01D1795F.2E170690
>
> When we need to show the page to the user we call:
>
> cid:image008.png@01D1795F.F6656830
>
> But this time *_future is not any more containing the original value 
> but is null!!!_* This because the variable is declared transient and 
> we passed through a serialization that apparently before we were not. 
> Do you have explanations to that? Maybe something changed between the 
> old version? Idea on how to solve it? (even creating a detachable 
> model it seems not solving the issue because the Future variable 
> doesn’t have any id that I can keep to retrieve it after the 
> serialization.
>
> The two classes are attached to the mail if you need to have a deeper 
> look.
>
> Your help it will be really appreciated.
>
> *Kind regards,*
> ___________________________*
> **Daniele Ippoliti
> *Software Engineer, PMP*®*
>
> R&D-NBU-AHP-HDI-BWS-HBK
>
> Amadeus SAS
> Phone: +33 (0) 4 97042180
> daniele.ippoliti@amadeus.com <ma...@amadeus.com>_
> _Description: cid:image001.png@01D05671.86C8BCA0 <http://www.amadeus.com/>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org