You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Antoine Angénieux <aa...@clinigrid.com> on 2008/04/01 20:17:29 UTC

Page versions disk serialization : no exception with a non serializable nested element

I just fixed a bug in one of my wicket apps that was linked to page 
versions disk serialization...

I had an object that did not implement Serializable that was deep down 
in the object instances hierarchy (like page -> some object -> ...  --> 
non serializable object).

Wicket never complained about any serialization problem, but off course, 
when my page was restored from the disk store, it was deserialized 
without any of its attributes (thus causing some null pointer exception 
in my code).

I was wondering if that was the expected behavior, and if not, if it was 
the DiskPageStore that was to blame of the plain old java serialization 
mechanism...

What do you guys think ?

Cheers,

Antoine.


-- 
Antoine Angénieux
Associé

Clinigrid
5, avenue Mozart
75016 Paris, France
+336 60 21 09 18
aangenieux@clinigrid.com



Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by Antoine Angenieux <aa...@clinigrid.com>.
Yes, i agree... just wanted to close the subject as this is why i 
couldn't find any trace in the logs.

Cheers,

Antoine.

Johan Compagner wrote:
> I already closed that as won't fix
> that is how serialization works.. A class that can be serialized that
> extends something cant be serialized
> then the super class is not suddenly serialized, thats not how it works
> For that class the default constructor is called which is responsible for
> its own class
> and if the default constructor doesnt do that then the serializable sub is
> responsible for that
> 
> johan
> 
> 
> On Wed, Apr 2, 2008 at 6:24 PM, Antoine Angenieux <aa...@clinigrid.com>
> wrote:
> 
>> Okay guys, i finally figured it out, and i've setup a quickstart that i've
>> attached to the jira issue
>> http://issues.apache.org/jira/browse/WICKET-1474.
>>
>> I won't go into deeper explanations in this mail as i guess the jira is a
>> more suitable place ;)
>>
>> Cheers,
>>
>> Antoine.
>>
>>
>> Antoine Angenieux wrote:
>>
>>> Yep, i'll do that this WE, create a jira issue and attach a quickstart
>>> ;)
>>>
>>> James Carman wrote:
>>>
>>>> On Wed, Apr 2, 2008 at 8:52 AM, Antoine Angenieux
>>>> <aa...@clinigrid.com> wrote:
>>>>
>>>>> I've checked all the logs many times, and i just went through a few
>>>>> of them
>>>>> a few minutes ago... checking all errors logged, and no trace of
>>>>> serialization issues...
>>>>>
>>>>>
>>>> Can you put together a Quickstart which exhibits this behavior?
>>>>
>>>>
>> --
>> Antoine Angénieux
>> Associé
>>
>> Clinigrid
>> 5, avenue Mozart
>> 75016 Paris, France
>> +336 60 21 09 18
>> aangenieux@clinigrid.com
>>
>>
>>
> 

-- 
Antoine Angénieux
Associé

Clinigrid
5, avenue Mozart
75016 Paris, France
+336 60 21 09 18
aangenieux@clinigrid.com



Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by Johan Compagner <jc...@gmail.com>.
I already closed that as won't fix
that is how serialization works.. A class that can be serialized that
extends something cant be serialized
then the super class is not suddenly serialized, thats not how it works
For that class the default constructor is called which is responsible for
its own class
and if the default constructor doesnt do that then the serializable sub is
responsible for that

johan


On Wed, Apr 2, 2008 at 6:24 PM, Antoine Angenieux <aa...@clinigrid.com>
wrote:

> Okay guys, i finally figured it out, and i've setup a quickstart that i've
> attached to the jira issue
> http://issues.apache.org/jira/browse/WICKET-1474.
>
> I won't go into deeper explanations in this mail as i guess the jira is a
> more suitable place ;)
>
> Cheers,
>
> Antoine.
>
>
> Antoine Angenieux wrote:
>
> > Yep, i'll do that this WE, create a jira issue and attach a quickstart
> > ;)
> >
> > James Carman wrote:
> >
> > > On Wed, Apr 2, 2008 at 8:52 AM, Antoine Angenieux
> > > <aa...@clinigrid.com> wrote:
> > >
> > > > I've checked all the logs many times, and i just went through a few
> > > > of them
> > > > a few minutes ago... checking all errors logged, and no trace of
> > > > serialization issues...
> > > >
> > > >
> > > Can you put together a Quickstart which exhibits this behavior?
> > >
> > >
> >
> --
> Antoine Angénieux
> Associé
>
> Clinigrid
> 5, avenue Mozart
> 75016 Paris, France
> +336 60 21 09 18
> aangenieux@clinigrid.com
>
>
>

Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by Igor Vaynberg <ig...@gmail.com>.
actually here is the preferrable place for the explanation and discussion...

-igor


On Wed, Apr 2, 2008 at 9:24 AM, Antoine Angenieux
<aa...@clinigrid.com> wrote:
> Okay guys, i finally figured it out, and i've setup a quickstart that i've
> attached to the jira issue
>  http://issues.apache.org/jira/browse/WICKET-1474.
>
>  I won't go into deeper explanations in this mail as i guess the jira is a
> more suitable place ;)
>
>  Cheers,
>
>  Antoine.
>
>
>
>  Antoine Angenieux wrote:
>
> > Yep, i'll do that this WE, create a jira issue and attach a quickstart ;)
> >
> > James Carman wrote:
> >
> > > On Wed, Apr 2, 2008 at 8:52 AM, Antoine Angenieux
> > > <aa...@clinigrid.com> wrote:
> > >
> > > > I've checked all the logs many times, and i just went through a few of
> them
> > > > a few minutes ago... checking all errors logged, and no trace of
> > > > serialization issues...
> > > >
> > > >
> > >
> > > Can you put together a Quickstart which exhibits this behavior?
> > >
> > >
> >
> >
>
>  --
>  Antoine Angénieux
>  Associé
>
>  Clinigrid
>  5, avenue Mozart
>  75016 Paris, France
>  +336 60 21 09 18
>  aangenieux@clinigrid.com
>
>
>

Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by Antoine Angenieux <aa...@clinigrid.com>.
Okay guys, i finally figured it out, and i've setup a quickstart that 
i've attached to the jira issue
http://issues.apache.org/jira/browse/WICKET-1474.

I won't go into deeper explanations in this mail as i guess the jira is 
a more suitable place ;)

Cheers,

Antoine.

Antoine Angenieux wrote:
> Yep, i'll do that this WE, create a jira issue and attach a quickstart ;)
> 
> James Carman wrote:
>> On Wed, Apr 2, 2008 at 8:52 AM, Antoine Angenieux
>> <aa...@clinigrid.com> wrote:
>>> I've checked all the logs many times, and i just went through a few 
>>> of them
>>> a few minutes ago... checking all errors logged, and no trace of
>>> serialization issues...
>>>
>>
>> Can you put together a Quickstart which exhibits this behavior?
>>
> 

-- 
Antoine Angénieux
Associé

Clinigrid
5, avenue Mozart
75016 Paris, France
+336 60 21 09 18
aangenieux@clinigrid.com



Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by Antoine Angenieux <aa...@clinigrid.com>.
Yep, i'll do that this WE, create a jira issue and attach a quickstart ;)

James Carman wrote:
> On Wed, Apr 2, 2008 at 8:52 AM, Antoine Angenieux
> <aa...@clinigrid.com> wrote:
>> I've checked all the logs many times, and i just went through a few of them
>> a few minutes ago... checking all errors logged, and no trace of
>> serialization issues...
>>
> 
> Can you put together a Quickstart which exhibits this behavior?
> 

-- 
Antoine Angénieux
Associé

Clinigrid
5, avenue Mozart
75016 Paris, France
+336 60 21 09 18
aangenieux@clinigrid.com



Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by James Carman <ja...@carmanconsulting.com>.
On Wed, Apr 2, 2008 at 8:52 AM, Antoine Angenieux
<aa...@clinigrid.com> wrote:
> I've checked all the logs many times, and i just went through a few of them
> a few minutes ago... checking all errors logged, and no trace of
> serialization issues...
>

Can you put together a Quickstart which exhibits this behavior?

Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by Antoine Angenieux <aa...@clinigrid.com>.
I've checked all the logs many times, and i just went through a few of 
them a few minutes ago... checking all errors logged, and no trace of 
serialization issues...

Antoine.

Matej Knopp wrote:
> Check your logs. I'm pretty sure the wicket have complained. But it
> doesn't show an error page in this case, just logs the error.
> 
> -Matej
> 
> On Wed, Apr 2, 2008 at 11:05 AM, Antoine Angénieux
> <aa...@clinigrid.com> wrote:
>>  Hi Matej, I guess i've not been as clear as i should have ;)
>>
>>  What I meant is that i THOUGHT the class instance was not referenced in the
>>  page :D
>>
>>  Whereas in fact, the non serializable class instance was referenced
>>  indirectly by my wicket page...
>>
>>  I had something like :
>>  WicketPage -> Instance of class A -> instance of class B  -> instance of
>>  class C (which was not serializable) -> instances of other classes (all
>>  serializable)
>>
>>  The non serializable C Class contained only simple Serializable attribute,
>>  but was not tagged as Serializable.
>>
>>  But the serialization mechanism never complained, and after deserialization,
>>  I had the object graph below :
>>
>>  WicketPage -> Instance of class A -> instance of class B  -> instance of
>>  class C
>>  but the instance of class C had all of its attributes set to null.
>>
>>  And as I've said in this thread, none of the attributes of class C are
>>  marked as transient.
>>
>>  As soon as i added the Serializable interface to the C class, all my
>>  troubles were gone...
>>
>>  Cheers,
>>
>>  Antoine.
>>
>>
>>
>>
>>  Matej Knopp-2 wrote:
>>  >
>>  > How can the attributes belong to a non-serializable class that wasn't
>>  > referenced in the page?
>>  >
>>  > -Matej
>>  >
>>  > On Wed, Apr 2, 2008 at 1:15 AM, Antoine Angénieux
>>  > <aa...@clinigrid.com> wrote:
>>  >> That's the weird thing : I never encountered any exception during
>>  >>  serialization (as i tried to debug that very specific wicket task today
>>  >>  ;)). That's why i was wondering if it could be the java serialization
>>  >>  mechanism that was buggy... No exception thrown, no log trace !
>>  >>
>>  >>  And the attributes in question were not transient, they just belonged to
>>  >>  a non serializable class that i didn't think was referenced in a page.
>>  >>
>>  >>  Antoine.
>>  >>
>>  >>
>>  >
>>
>>  --
>>  View this message in context: http://www.nabble.com/Page-versions-disk-serialization-%3A-no-exception-with-a-non-serializable-nested-element-tp16430709p16445836.html
>>  Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 
> 

-- 
Antoine Angénieux
Associé

Clinigrid
5, avenue Mozart
75016 Paris, France
+336 60 21 09 18
aangenieux@clinigrid.com



Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by Matej Knopp <ma...@gmail.com>.
Check your logs. I'm pretty sure the wicket have complained. But it
doesn't show an error page in this case, just logs the error.

-Matej

On Wed, Apr 2, 2008 at 11:05 AM, Antoine Angénieux
<aa...@clinigrid.com> wrote:
>
>  Hi Matej, I guess i've not been as clear as i should have ;)
>
>  What I meant is that i THOUGHT the class instance was not referenced in the
>  page :D
>
>  Whereas in fact, the non serializable class instance was referenced
>  indirectly by my wicket page...
>
>  I had something like :
>  WicketPage -> Instance of class A -> instance of class B  -> instance of
>  class C (which was not serializable) -> instances of other classes (all
>  serializable)
>
>  The non serializable C Class contained only simple Serializable attribute,
>  but was not tagged as Serializable.
>
>  But the serialization mechanism never complained, and after deserialization,
>  I had the object graph below :
>
>  WicketPage -> Instance of class A -> instance of class B  -> instance of
>  class C
>  but the instance of class C had all of its attributes set to null.
>
>  And as I've said in this thread, none of the attributes of class C are
>  marked as transient.
>
>  As soon as i added the Serializable interface to the C class, all my
>  troubles were gone...
>
>  Cheers,
>
>  Antoine.
>
>
>
>
>  Matej Knopp-2 wrote:
>  >
>  > How can the attributes belong to a non-serializable class that wasn't
>  > referenced in the page?
>  >
>  > -Matej
>  >
>  > On Wed, Apr 2, 2008 at 1:15 AM, Antoine Angénieux
>  > <aa...@clinigrid.com> wrote:
>  >> That's the weird thing : I never encountered any exception during
>  >>  serialization (as i tried to debug that very specific wicket task today
>  >>  ;)). That's why i was wondering if it could be the java serialization
>  >>  mechanism that was buggy... No exception thrown, no log trace !
>  >>
>  >>  And the attributes in question were not transient, they just belonged to
>  >>  a non serializable class that i didn't think was referenced in a page.
>  >>
>  >>  Antoine.
>  >>
>  >>
>  >
>
>  --
>  View this message in context: http://www.nabble.com/Page-versions-disk-serialization-%3A-no-exception-with-a-non-serializable-nested-element-tp16430709p16445836.html
>  Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>



-- 
Resizable and reorderable grid components.
http://www.inmethod.com

Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by Antoine Angénieux <aa...@clinigrid.com>.
Hi Matej, I guess i've not been as clear as i should have ;)

What I meant is that i THOUGHT the class instance was not referenced in the
page :D

Whereas in fact, the non serializable class instance was referenced
indirectly by my wicket page...

I had something like :
WicketPage -> Instance of class A -> instance of class B  -> instance of
class C (which was not serializable) -> instances of other classes (all
serializable)

The non serializable C Class contained only simple Serializable attribute,
but was not tagged as Serializable.

But the serialization mechanism never complained, and after deserialization,
I had the object graph below :

WicketPage -> Instance of class A -> instance of class B  -> instance of
class C 
but the instance of class C had all of its attributes set to null.

And as I've said in this thread, none of the attributes of class C are
marked as transient.

As soon as i added the Serializable interface to the C class, all my
troubles were gone...

Cheers,

Antoine.


Matej Knopp-2 wrote:
> 
> How can the attributes belong to a non-serializable class that wasn't
> referenced in the page?
> 
> -Matej
> 
> On Wed, Apr 2, 2008 at 1:15 AM, Antoine Angénieux
> <aa...@clinigrid.com> wrote:
>> That's the weird thing : I never encountered any exception during
>>  serialization (as i tried to debug that very specific wicket task today
>>  ;)). That's why i was wondering if it could be the java serialization
>>  mechanism that was buggy... No exception thrown, no log trace !
>>
>>  And the attributes in question were not transient, they just belonged to
>>  a non serializable class that i didn't think was referenced in a page.
>>
>>  Antoine.
>>
>>
> 

-- 
View this message in context: http://www.nabble.com/Page-versions-disk-serialization-%3A-no-exception-with-a-non-serializable-nested-element-tp16430709p16445836.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by Matej Knopp <ma...@gmail.com>.
How can the attributes belong to a non-serializable class that wasn't
referenced in the page?

-Matej

On Wed, Apr 2, 2008 at 1:15 AM, Antoine Angénieux
<aa...@clinigrid.com> wrote:
> That's the weird thing : I never encountered any exception during
>  serialization (as i tried to debug that very specific wicket task today
>  ;)). That's why i was wondering if it could be the java serialization
>  mechanism that was buggy... No exception thrown, no log trace !
>
>  And the attributes in question were not transient, they just belonged to
>  a non serializable class that i didn't think was referenced in a page.
>
>  Antoine.
>
>
>
>
>  Matej Knopp wrote:
>  > Nope. But the exception should be in logs anyway.
>  >
>  > -Matej
>  >
>  > On Tue, Apr 1, 2008 at 9:26 PM, James Carman <ja...@carmanconsulting.com> wrote:
>  >> Oh, ok.  I thought since it was merely logging the error that it was
>  >>  going on in the thread.  So, Wicket doesn't stop your request if the
>  >>  page's data can't be serialized?
>  >>
>  >>
>  >>
>  >>  On Tue, Apr 1, 2008 at 3:19 PM, Matej Knopp <ma...@gmail.com> wrote:
>  >>  > But that's just saving. The serialization itself is done in the
>  >>  >  request thread. Only saving of the bytearray is done in separate
>  >>  >  thread.
>  >>  >
>  >>  >  There's a good reason for serializing the page in the request thread.
>  >>  >  We cache the serialized page data so when servlet container replicates
>  >>  >  the session we reuse the cached data. Also there were some locking and
>  >>  >  concurrency issues when we serialized the page in separate thread.
>  >>  >
>  >>  >  -Matej
>  >>  >
>  >>  >
>  >>  >
>  >>  >  On Tue, Apr 1, 2008 at 9:15 PM, James Carman <ja...@carmanconsulting.com> wrote:
>  >>  >  > On Tue, Apr 1, 2008 at 3:13 PM, lars vonk <la...@gmail.com> wrote:
>  >>  >  >  > The Exception is only logged (as ERROR) if something is not serializable, so
>  >>  >  >  >  it will only complain in your logfile. See Objects.objectToByteArray()
>  >>  >  >  >  method.
>  >>  >  >  >
>  >>  >  >  >  I don't think page serialization is done in a seperate Thread though. I
>  >>  >  >  >  couldn't find this in the code. But please correct me if I am wrong.
>  >>  >  >  >
>  >>  >  >
>  >>  >  >  Check out DiskPageStore.PageSavingThread.  If you pause your
>  >>  >  >  application, you'll see that one of those is running.
>  >>  >  >
>  >>  >
>  >>  >
>  >>  >
>  >>  >  --
>  >>  >
>  >>  >
>  >>  > Resizable and reorderable grid components.
>  >>  >  http://www.inmethod.com
>  >>  >
>  >>
>  >
>  >
>  >
>
>  --
>
>
> Antoine Angénieux
>  Associé
>
>  Clinigrid
>  5, avenue Mozart
>  75016 Paris, France
>  +336 60 21 09 18
>  aangenieux@clinigrid.com
>
>
>



-- 
Resizable and reorderable grid components.
http://www.inmethod.com

Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by Antoine Angénieux <aa...@clinigrid.com>.
That's the weird thing : I never encountered any exception during 
serialization (as i tried to debug that very specific wicket task today 
;)). That's why i was wondering if it could be the java serialization 
mechanism that was buggy... No exception thrown, no log trace !

And the attributes in question were not transient, they just belonged to 
a non serializable class that i didn't think was referenced in a page.

Antoine.


Matej Knopp wrote:
> Nope. But the exception should be in logs anyway.
> 
> -Matej
> 
> On Tue, Apr 1, 2008 at 9:26 PM, James Carman <ja...@carmanconsulting.com> wrote:
>> Oh, ok.  I thought since it was merely logging the error that it was
>>  going on in the thread.  So, Wicket doesn't stop your request if the
>>  page's data can't be serialized?
>>
>>
>>
>>  On Tue, Apr 1, 2008 at 3:19 PM, Matej Knopp <ma...@gmail.com> wrote:
>>  > But that's just saving. The serialization itself is done in the
>>  >  request thread. Only saving of the bytearray is done in separate
>>  >  thread.
>>  >
>>  >  There's a good reason for serializing the page in the request thread.
>>  >  We cache the serialized page data so when servlet container replicates
>>  >  the session we reuse the cached data. Also there were some locking and
>>  >  concurrency issues when we serialized the page in separate thread.
>>  >
>>  >  -Matej
>>  >
>>  >
>>  >
>>  >  On Tue, Apr 1, 2008 at 9:15 PM, James Carman <ja...@carmanconsulting.com> wrote:
>>  >  > On Tue, Apr 1, 2008 at 3:13 PM, lars vonk <la...@gmail.com> wrote:
>>  >  >  > The Exception is only logged (as ERROR) if something is not serializable, so
>>  >  >  >  it will only complain in your logfile. See Objects.objectToByteArray()
>>  >  >  >  method.
>>  >  >  >
>>  >  >  >  I don't think page serialization is done in a seperate Thread though. I
>>  >  >  >  couldn't find this in the code. But please correct me if I am wrong.
>>  >  >  >
>>  >  >
>>  >  >  Check out DiskPageStore.PageSavingThread.  If you pause your
>>  >  >  application, you'll see that one of those is running.
>>  >  >
>>  >
>>  >
>>  >
>>  >  --
>>  >
>>  >
>>  > Resizable and reorderable grid components.
>>  >  http://www.inmethod.com
>>  >
>>
> 
> 
> 

-- 
Antoine Angénieux
Associé

Clinigrid
5, avenue Mozart
75016 Paris, France
+336 60 21 09 18
aangenieux@clinigrid.com



Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by Matej Knopp <ma...@gmail.com>.
Nope. But the exception should be in logs anyway.

-Matej

On Tue, Apr 1, 2008 at 9:26 PM, James Carman <ja...@carmanconsulting.com> wrote:
> Oh, ok.  I thought since it was merely logging the error that it was
>  going on in the thread.  So, Wicket doesn't stop your request if the
>  page's data can't be serialized?
>
>
>
>  On Tue, Apr 1, 2008 at 3:19 PM, Matej Knopp <ma...@gmail.com> wrote:
>  > But that's just saving. The serialization itself is done in the
>  >  request thread. Only saving of the bytearray is done in separate
>  >  thread.
>  >
>  >  There's a good reason for serializing the page in the request thread.
>  >  We cache the serialized page data so when servlet container replicates
>  >  the session we reuse the cached data. Also there were some locking and
>  >  concurrency issues when we serialized the page in separate thread.
>  >
>  >  -Matej
>  >
>  >
>  >
>  >  On Tue, Apr 1, 2008 at 9:15 PM, James Carman <ja...@carmanconsulting.com> wrote:
>  >  > On Tue, Apr 1, 2008 at 3:13 PM, lars vonk <la...@gmail.com> wrote:
>  >  >  > The Exception is only logged (as ERROR) if something is not serializable, so
>  >  >  >  it will only complain in your logfile. See Objects.objectToByteArray()
>  >  >  >  method.
>  >  >  >
>  >  >  >  I don't think page serialization is done in a seperate Thread though. I
>  >  >  >  couldn't find this in the code. But please correct me if I am wrong.
>  >  >  >
>  >  >
>  >  >  Check out DiskPageStore.PageSavingThread.  If you pause your
>  >  >  application, you'll see that one of those is running.
>  >  >
>  >
>  >
>  >
>  >  --
>  >
>  >
>  > Resizable and reorderable grid components.
>  >  http://www.inmethod.com
>  >
>



-- 
Resizable and reorderable grid components.
http://www.inmethod.com

Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by James Carman <ja...@carmanconsulting.com>.
Oh, ok.  I thought since it was merely logging the error that it was
going on in the thread.  So, Wicket doesn't stop your request if the
page's data can't be serialized?

On Tue, Apr 1, 2008 at 3:19 PM, Matej Knopp <ma...@gmail.com> wrote:
> But that's just saving. The serialization itself is done in the
>  request thread. Only saving of the bytearray is done in separate
>  thread.
>
>  There's a good reason for serializing the page in the request thread.
>  We cache the serialized page data so when servlet container replicates
>  the session we reuse the cached data. Also there were some locking and
>  concurrency issues when we serialized the page in separate thread.
>
>  -Matej
>
>
>
>  On Tue, Apr 1, 2008 at 9:15 PM, James Carman <ja...@carmanconsulting.com> wrote:
>  > On Tue, Apr 1, 2008 at 3:13 PM, lars vonk <la...@gmail.com> wrote:
>  >  > The Exception is only logged (as ERROR) if something is not serializable, so
>  >  >  it will only complain in your logfile. See Objects.objectToByteArray()
>  >  >  method.
>  >  >
>  >  >  I don't think page serialization is done in a seperate Thread though. I
>  >  >  couldn't find this in the code. But please correct me if I am wrong.
>  >  >
>  >
>  >  Check out DiskPageStore.PageSavingThread.  If you pause your
>  >  application, you'll see that one of those is running.
>  >
>
>
>
>  --
>
>
> Resizable and reorderable grid components.
>  http://www.inmethod.com
>

Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by Matej Knopp <ma...@gmail.com>.
But that's just saving. The serialization itself is done in the
request thread. Only saving of the bytearray is done in separate
thread.

There's a good reason for serializing the page in the request thread.
We cache the serialized page data so when servlet container replicates
the session we reuse the cached data. Also there were some locking and
concurrency issues when we serialized the page in separate thread.

-Matej

On Tue, Apr 1, 2008 at 9:15 PM, James Carman <ja...@carmanconsulting.com> wrote:
> On Tue, Apr 1, 2008 at 3:13 PM, lars vonk <la...@gmail.com> wrote:
>  > The Exception is only logged (as ERROR) if something is not serializable, so
>  >  it will only complain in your logfile. See Objects.objectToByteArray()
>  >  method.
>  >
>  >  I don't think page serialization is done in a seperate Thread though. I
>  >  couldn't find this in the code. But please correct me if I am wrong.
>  >
>
>  Check out DiskPageStore.PageSavingThread.  If you pause your
>  application, you'll see that one of those is running.
>



-- 
Resizable and reorderable grid components.
http://www.inmethod.com

Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by James Carman <ja...@carmanconsulting.com>.
On Tue, Apr 1, 2008 at 3:13 PM, lars vonk <la...@gmail.com> wrote:
> The Exception is only logged (as ERROR) if something is not serializable, so
>  it will only complain in your logfile. See Objects.objectToByteArray()
>  method.
>
>  I don't think page serialization is done in a seperate Thread though. I
>  couldn't find this in the code. But please correct me if I am wrong.
>

Check out DiskPageStore.PageSavingThread.  If you pause your
application, you'll see that one of those is running.

Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by lars vonk <la...@gmail.com>.
The Exception is only logged (as ERROR) if something is not serializable, so
it will only complain in your logfile. See Objects.objectToByteArray()
method.

I don't think page serialization is done in a seperate Thread though. I
couldn't find this in the code. But please correct me if I am wrong.

Lars



On Tue, Apr 1, 2008 at 9:09 PM, Matej Knopp <ma...@gmail.com> wrote:

> Are you sure your attributes were not transient? There's no way wicket
> would skip it without an error. ObjectOutputStream should certainly
> complain and we do log the serialization exception.
>
> -Matej
>
> On Tue, Apr 1, 2008 at 8:31 PM, James Carman <ja...@carmanconsulting.com>
> wrote:
> > On Tue, Apr 1, 2008 at 2:17 PM, Antoine Angénieux
> >  <aa...@clinigrid.com> wrote:
> >  > I just fixed a bug in one of my wicket apps that was linked to page
> >  >  versions disk serialization...
> >  >
> >  >  I had an object that did not implement Serializable that was deep
> down
> >  >  in the object instances hierarchy (like page -> some object -> ...
>  -->
> >  >  non serializable object).
> >  >
> >  >  Wicket never complained about any serialization problem, but off
> course,
> >  >  when my page was restored from the disk store, it was deserialized
> >  >  without any of its attributes (thus causing some null pointer
> exception
> >  >  in my code).
> >  >
> >  >  I was wondering if that was the expected behavior, and if not, if it
> was
> >  >  the DiskPageStore that was to blame of the plain old java
> serialization
> >  >  mechanism...
> >  >
> >  >  What do you guys think ?
> >
> >  I believe the disk store stuff is done in another thread.  Are you
> >  sure it didn't print off the error message in your logs and you didn't
> >  notice it?
> >
>
>
>
> --
> Resizable and reorderable grid components.
> http://www.inmethod.com
>

Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by Matej Knopp <ma...@gmail.com>.
Are you sure your attributes were not transient? There's no way wicket
would skip it without an error. ObjectOutputStream should certainly
complain and we do log the serialization exception.

-Matej

On Tue, Apr 1, 2008 at 8:31 PM, James Carman <ja...@carmanconsulting.com> wrote:
> On Tue, Apr 1, 2008 at 2:17 PM, Antoine Angénieux
>  <aa...@clinigrid.com> wrote:
>  > I just fixed a bug in one of my wicket apps that was linked to page
>  >  versions disk serialization...
>  >
>  >  I had an object that did not implement Serializable that was deep down
>  >  in the object instances hierarchy (like page -> some object -> ...  -->
>  >  non serializable object).
>  >
>  >  Wicket never complained about any serialization problem, but off course,
>  >  when my page was restored from the disk store, it was deserialized
>  >  without any of its attributes (thus causing some null pointer exception
>  >  in my code).
>  >
>  >  I was wondering if that was the expected behavior, and if not, if it was
>  >  the DiskPageStore that was to blame of the plain old java serialization
>  >  mechanism...
>  >
>  >  What do you guys think ?
>
>  I believe the disk store stuff is done in another thread.  Are you
>  sure it didn't print off the error message in your logs and you didn't
>  notice it?
>



-- 
Resizable and reorderable grid components.
http://www.inmethod.com

Re: Page versions disk serialization : no exception with a non serializable nested element

Posted by James Carman <ja...@carmanconsulting.com>.
On Tue, Apr 1, 2008 at 2:17 PM, Antoine Angénieux
<aa...@clinigrid.com> wrote:
> I just fixed a bug in one of my wicket apps that was linked to page
>  versions disk serialization...
>
>  I had an object that did not implement Serializable that was deep down
>  in the object instances hierarchy (like page -> some object -> ...  -->
>  non serializable object).
>
>  Wicket never complained about any serialization problem, but off course,
>  when my page was restored from the disk store, it was deserialized
>  without any of its attributes (thus causing some null pointer exception
>  in my code).
>
>  I was wondering if that was the expected behavior, and if not, if it was
>  the DiskPageStore that was to blame of the plain old java serialization
>  mechanism...
>
>  What do you guys think ?

I believe the disk store stuff is done in another thread.  Are you
sure it didn't print off the error message in your logs and you didn't
notice it?