You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Jan Vermeulen <ja...@isencia.com> on 2006/10/04 16:15:56 UTC
wicket.response.StringResponse not serializable (Wicket 2.0)
I changed the sessionStore of my application (using Wicket 2.0) to be
'wicket.protocol.http.HttpSessionStore' i.s.o.
'wicket.protocol.http.SecondLevelCacheSessionStore' (because I use methods
in the AccessStackPageMap that are not supported in the pageMap of
SecondLevelCacheSessionStore).
When saving my first page in the HTTPSession, HttpSessionStore tries to
serialize it and throws the following exception:
Caused by: java.io.NotSerializableException: wicket.response.StringResponse
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at
wicket.protocol.http.HttpSessionStore.setAttribute(HttpSessionStore.java:60)
... 26 more
Is this a bug in Wicket ? Should StringResponse implement Serializable ?
--
View this message in context: http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6640372
Sent from the Wicket - Dev mailing list archive at Nabble.com.
Re: wicket.response.StringResponse not serializable (Wicket 2.0)
Posted by Johan Compagner <jc...@gmail.com>.
of course it can or should be transient
But that does hide a bug then if it keeps being there between request. (that
would be a "leak")
johan
On 10/5/06, Juergen Donnerstag <ju...@gmail.com> wrote:
>
> But headerResponse can be transient as well. It is/should only be used
> during the render process and doesn't change in between requests.
>
> Juergen
>
> On 10/5/06, Johan Compagner <jc...@gmail.com> wrote:
> > no httpsessionstore should detach everything of the page.
> > Doesn't it do that? Because pages should be stored on disk comletely
> > detached.
> >
> > johan
> >
> >
> > On 10/5/06, Jan Vermeulen <ja...@isencia.com> wrote:
> > >
> > >
> > > It does get cleared when RequestCycle calls detach(), but that happens
> > > AFTER
> > > the touch() of the session where the page is stored in the
> sessionStore.
> > > So
> > > the store fails, because HttpSessionStore intents to serialize in its
> > > setAttribute().
> > >
> > > I made 'headerResponse' transient in my workspace, and it solves my
> > > problem.
> > > Could this be done in Wicket ? For now, I can't use HttpSessionStore
> > > without
> > > this change.
> > >
> > > Jan.
> > >
> > >
> > > Matej Knopp wrote:
> > > >
> > > > No matter what response is stored in header response, it should be
> > > > cleared at the end of request - HeaderContainer.onDetach cleans it.
> This
> > > > detach should be done before detaching it. If it's not, then there
> is a
> > > > problem.
> > > >
> > > > -Matej
> > > >
> > > > Jan Vermeulen wrote:
> > > >> I have been investigating a little, and I thing we`re talking about
> a
> > > bug
> > > >> here.
> > > >>
> > > >> The component that is holding a reference to a Response is
> > > >> 'wicket.markup.html.internal.HtmlHeaderContainer (in its superclass
> > > >> 'wicket.markup.html.internal.HeaderContainer'). That attribute is
> not
> > > >> transient, and gets lazily initialized:
> > > >>
> > > >> public IHeaderResponse getHeaderResponse() {
> > > >> if (this.headerResponse == null)
> > > >> {
> > > >> headerResponse = new
> > > HeaderResponse(getResponse());
> > > >> }
> > > >> return headerResponse;
> > > >> }
> > > >>
> > > >> I suppose the problem occurs in the following code of the method
> > > >> 'onComponentTagBody()':
> > > >>
> > > >> // Temporarily replace the web response with a String
> > > response
> > > >> final Response webResponse = this.getResponse();
> > > >>
> > > >> try
> > > >> {
> > > >> final StringResponse response = new
> > > StringResponse();
> > > >> this.getRequestCycle().setResponse(response);
> > > >>
> > > >> If the headerResponse is not yet initialized at that time, you
> might
> > > >> end-up
> > > >> with a reference to a StringResponse because that is what is
> available
> > > on
> > > >> the requestCycle at that moment.
> > > >>
> > > >> I found that the StringResponse instance that HttpSessionStore
> tried to
> > > >> serialize was the same that was created (temporarily) by the
> > > >> HtmlHeaderContainer, and got stored into the 'headerResponse'
> > > attribute.
> > > >>
> > > >> Maybe 'headerResponse' should be transient, or it should be
> initialized
> > > >> before the response of the requestCycle is switched to a
> > > StringResponse.
> > > >>
> > > >> Jan.
> > > >>
> > > >>
> > > >> Matej Knopp wrote:
> > > >>> It shouldn't implement Serializable. It should never get
> serialized.
> > > The
> > > >>> problem might be that you hold reference to response somewhere in
> > > your
> > > >>> components? (just a quess)
> > > >>>
> > > >>> -Matej
> > > >>>
> > > >>> Jan Vermeulen wrote:
> > > >>>> I changed the sessionStore of my application (using Wicket 2.0)
> to be
> > > >>>> 'wicket.protocol.http.HttpSessionStore' i.s.o.
> > > >>>> 'wicket.protocol.http.SecondLevelCacheSessionStore' (because I
> use
> > > >>>> methods
> > > >>>> in the AccessStackPageMap that are not supported in the pageMap
> of
> > > >>>> SecondLevelCacheSessionStore).
> > > >>>>
> > > >>>> When saving my first page in the HTTPSession, HttpSessionStore
> tries
> > > to
> > > >>>> serialize it and throws the following exception:
> > > >>>>
> > > >>>> Caused by: java.io.NotSerializableException:
> > > >>>> wicket.response.StringResponse
> > > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> > > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
> Source)
> > > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> > > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
> Source)
> > > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> > > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
> Source)
> > > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> > > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
> Source)
> > > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> > > >>>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
> > > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> > > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
> Source)
> > > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> > > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
> Source)
> > > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> > > >>>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
> > > >>>> at
> > > >>>> wicket.protocol.http.HttpSessionStore.setAttribute(
> > > HttpSessionStore.java:60)
> > > >>>> ... 26 more
> > > >>>>
> > > >>>> Is this a bug in Wicket ? Should StringResponse implement
> > > Serializable
> > > >>>> ?
> > > >>>
> > > >>>
> > > >>
> > > >
> > > >
> > > >
> > >
> > > --
> > > View this message in context:
> > >
> http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6655919
> > > Sent from the Wicket - Dev mailing list archive at Nabble.com.
> > >
> > >
> >
> >
>
Re: wicket.response.StringResponse not serializable (Wicket 2.0)
Posted by Johan Compagner <jc...@gmail.com>.
i fixed this problem by detaching and making it transient.
The secondlevel pagemap doesn't really have a stack of pages
it only has one. (the active) and can search for all others that are made
when needed (back button used)
I should warn you that pagemap as they are now could be completely removed
or rewritten.
You use a feature of it that is more or less internal code ... and cant
depended on.
johan
On 10/5/06, Jan Vermeulen <ja...@isencia.com> wrote:
>
>
> Indeed, it's in this 'test' code that it fails.
> What we want to do is use the pageMap for relative page navigation (f.i.
> return to the previous page): with the AccessStackPageMap we could search
> the accessStack until it encounters an entry with a different pageId, and
> clear the stack upto that entry. When navigating to a previous page, we
> actually do want these pages to dissappear from the pageMap (Backbutton
> support makes no sense here).
>
> But PageMap itself does not have methods to iterate the stack of entries,
> so
> that broke our code when upgrading to Wicket 2.0 where the default
> implementation does not have an accessStack.
>
> Jan.
>
>
> Johan Compagner wrote:
> >
> > Ahh and you are just testing the serializable nature
> > Because normally the httpsession store doesn't store it directly, but we
> > have a test there to test the serializeable nature
> > We should do there detach()
> >
> > What methods do you need ro the accessstackpagemap??
> >
> > johan
> >
> >
> > On 10/5/06, Jan Vermeulen <ja...@isencia.com> wrote:
> >>
> >>
> >> session.touch() puts the page on the PageMap, and the
> AccessStackPageMap
> >> calls setAttribute on the HttpSessionStore to save the page on the
> >> HttpSession. But no detach is done by none of these.
> >>
> >>
> >> Juergen Donnerstag wrote:
> >> >
> >> > But headerResponse can be transient as well. It is/should only be
> used
> >> > during the render process and doesn't change in between requests.
> >> >
> >> > Juergen
> >> >
> >> > On 10/5/06, Johan Compagner <jc...@gmail.com> wrote:
> >> >> no httpsessionstore should detach everything of the page.
> >> >> Doesn't it do that? Because pages should be stored on disk comletely
> >> >> detached.
> >> >>
> >> >> johan
> >> >>
> >> >>
> >> >> On 10/5/06, Jan Vermeulen <ja...@isencia.com> wrote:
> >> >> >
> >> >> >
> >> >> > It does get cleared when RequestCycle calls detach(), but that
> >> happens
> >> >> > AFTER
> >> >> > the touch() of the session where the page is stored in the
> >> >> sessionStore.
> >> >> > So
> >> >> > the store fails, because HttpSessionStore intents to serialize in
> >> its
> >> >> > setAttribute().
> >> >> >
> >> >> > I made 'headerResponse' transient in my workspace, and it solves
> my
> >> >> > problem.
> >> >> > Could this be done in Wicket ? For now, I can't use
> HttpSessionStore
> >> >> > without
> >> >> > this change.
> >> >> >
> >> >> > Jan.
> >> >> >
> >> >> >
> >> >> > Matej Knopp wrote:
> >> >> > >
> >> >> > > No matter what response is stored in header response, it should
> be
> >> >> > > cleared at the end of request - HeaderContainer.onDetach cleans
> >> it.
> >> >> This
> >> >> > > detach should be done before detaching it. If it's not, then
> there
> >> is
> >> >> a
> >> >> > > problem.
> >> >> > >
> >> >> > > -Matej
> >> >> > >
> >> >> > > Jan Vermeulen wrote:
> >> >> > >> I have been investigating a little, and I thing we`re talking
> >> about
> >> >> a
> >> >> > bug
> >> >> > >> here.
> >> >> > >>
> >> >> > >> The component that is holding a reference to a Response is
> >> >> > >> 'wicket.markup.html.internal.HtmlHeaderContainer (in its
> >> superclass
> >> >> > >> 'wicket.markup.html.internal.HeaderContainer'). That attribute
> is
> >> >> not
> >> >> > >> transient, and gets lazily initialized:
> >> >> > >>
> >> >> > >> public IHeaderResponse getHeaderResponse() {
> >> >> > >> if (this.headerResponse == null)
> >> >> > >> {
> >> >> > >> headerResponse = new
> >> >> > HeaderResponse(getResponse());
> >> >> > >> }
> >> >> > >> return headerResponse;
> >> >> > >> }
> >> >> > >>
> >> >> > >> I suppose the problem occurs in the following code of the
> method
> >> >> > >> 'onComponentTagBody()':
> >> >> > >>
> >> >> > >> // Temporarily replace the web response with a
> >> String
> >> >> > response
> >> >> > >> final Response webResponse = this.getResponse();
> >> >> > >>
> >> >> > >> try
> >> >> > >> {
> >> >> > >> final StringResponse response = new
> >> >> > StringResponse();
> >> >> > >>
> >> this.getRequestCycle().setResponse(response);
> >> >> > >>
> >> >> > >> If the headerResponse is not yet initialized at that time, you
> >> might
> >> >> > >> end-up
> >> >> > >> with a reference to a StringResponse because that is what is
> >> >> available
> >> >> > on
> >> >> > >> the requestCycle at that moment.
> >> >> > >>
> >> >> > >> I found that the StringResponse instance that HttpSessionStore
> >> tried
> >> >> to
> >> >> > >> serialize was the same that was created (temporarily) by the
> >> >> > >> HtmlHeaderContainer, and got stored into the 'headerResponse'
> >> >> > attribute.
> >> >> > >>
> >> >> > >> Maybe 'headerResponse' should be transient, or it should be
> >> >> initialized
> >> >> > >> before the response of the requestCycle is switched to a
> >> >> > StringResponse.
> >> >> > >>
> >> >> > >> Jan.
> >> >> > >>
> >> >> > >>
> >> >> > >> Matej Knopp wrote:
> >> >> > >>> It shouldn't implement Serializable. It should never get
> >> >> serialized.
> >> >> > The
> >> >> > >>> problem might be that you hold reference to response
> somewhere
> >> in
> >> >> > your
> >> >> > >>> components? (just a quess)
> >> >> > >>>
> >> >> > >>> -Matej
> >> >> > >>>
> >> >> > >>> Jan Vermeulen wrote:
> >> >> > >>>> I changed the sessionStore of my application (using Wicket
> 2.0)
> >> to
> >> >> be
> >> >> > >>>> 'wicket.protocol.http.HttpSessionStore' i.s.o.
> >> >> > >>>> 'wicket.protocol.http.SecondLevelCacheSessionStore' (because
> I
> >> >> use
> >> >> > >>>> methods
> >> >> > >>>> in the AccessStackPageMap that are not supported in the
> pageMap
> >> of
> >> >> > >>>> SecondLevelCacheSessionStore).
> >> >> > >>>>
> >> >> > >>>> When saving my first page in the HTTPSession,
> HttpSessionStore
> >> >> tries
> >> >> > to
> >> >> > >>>> serialize it and throws the following exception:
> >> >> > >>>>
> >> >> > >>>> Caused by: java.io.NotSerializableException:
> >> >> > >>>> wicket.response.StringResponse
> >> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >> >> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
> >> >> Source)
> >> >> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown
> >> Source)
> >> >> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
> >> >> Source)
> >> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >> >> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
> >> >> Source)
> >> >> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown
> >> Source)
> >> >> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
> >> >> Source)
> >> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >> >> > >>>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
> >> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >> >> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
> >> >> Source)
> >> >> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown
> >> Source)
> >> >> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
> >> >> Source)
> >> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >> >> > >>>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
> >> >> > >>>> at
> >> >> > >>>> wicket.protocol.http.HttpSessionStore.setAttribute(
> >> >> > HttpSessionStore.java:60)
> >> >> > >>>> ... 26 more
> >> >> > >>>>
> >> >> > >>>> Is this a bug in Wicket ? Should StringResponse implement
> >> >> > Serializable
> >> >> > >>>> ?
> >> >> > >>>
> >> >> > >>>
> >> >> > >>
> >> >> > >
> >> >> > >
> >> >> > >
> >> >> >
> >> >> > --
> >> >> > View this message in context:
> >> >> >
> >> >>
> >>
> http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6655919
> >> >> > Sent from the Wicket - Dev mailing list archive at Nabble.com.
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6659396
> >> Sent from the Wicket - Dev mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6660647
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>
Re: wicket.response.StringResponse not serializable (Wicket 2.0)
Posted by Jan Vermeulen <ja...@isencia.com>.
Indeed, it's in this 'test' code that it fails.
What we want to do is use the pageMap for relative page navigation (f.i.
return to the previous page): with the AccessStackPageMap we could search
the accessStack until it encounters an entry with a different pageId, and
clear the stack upto that entry. When navigating to a previous page, we
actually do want these pages to dissappear from the pageMap (Backbutton
support makes no sense here).
But PageMap itself does not have methods to iterate the stack of entries, so
that broke our code when upgrading to Wicket 2.0 where the default
implementation does not have an accessStack.
Jan.
Johan Compagner wrote:
>
> Ahh and you are just testing the serializable nature
> Because normally the httpsession store doesn't store it directly, but we
> have a test there to test the serializeable nature
> We should do there detach()
>
> What methods do you need ro the accessstackpagemap??
>
> johan
>
>
> On 10/5/06, Jan Vermeulen <ja...@isencia.com> wrote:
>>
>>
>> session.touch() puts the page on the PageMap, and the AccessStackPageMap
>> calls setAttribute on the HttpSessionStore to save the page on the
>> HttpSession. But no detach is done by none of these.
>>
>>
>> Juergen Donnerstag wrote:
>> >
>> > But headerResponse can be transient as well. It is/should only be used
>> > during the render process and doesn't change in between requests.
>> >
>> > Juergen
>> >
>> > On 10/5/06, Johan Compagner <jc...@gmail.com> wrote:
>> >> no httpsessionstore should detach everything of the page.
>> >> Doesn't it do that? Because pages should be stored on disk comletely
>> >> detached.
>> >>
>> >> johan
>> >>
>> >>
>> >> On 10/5/06, Jan Vermeulen <ja...@isencia.com> wrote:
>> >> >
>> >> >
>> >> > It does get cleared when RequestCycle calls detach(), but that
>> happens
>> >> > AFTER
>> >> > the touch() of the session where the page is stored in the
>> >> sessionStore.
>> >> > So
>> >> > the store fails, because HttpSessionStore intents to serialize in
>> its
>> >> > setAttribute().
>> >> >
>> >> > I made 'headerResponse' transient in my workspace, and it solves my
>> >> > problem.
>> >> > Could this be done in Wicket ? For now, I can't use HttpSessionStore
>> >> > without
>> >> > this change.
>> >> >
>> >> > Jan.
>> >> >
>> >> >
>> >> > Matej Knopp wrote:
>> >> > >
>> >> > > No matter what response is stored in header response, it should be
>> >> > > cleared at the end of request - HeaderContainer.onDetach cleans
>> it.
>> >> This
>> >> > > detach should be done before detaching it. If it's not, then there
>> is
>> >> a
>> >> > > problem.
>> >> > >
>> >> > > -Matej
>> >> > >
>> >> > > Jan Vermeulen wrote:
>> >> > >> I have been investigating a little, and I thing we`re talking
>> about
>> >> a
>> >> > bug
>> >> > >> here.
>> >> > >>
>> >> > >> The component that is holding a reference to a Response is
>> >> > >> 'wicket.markup.html.internal.HtmlHeaderContainer (in its
>> superclass
>> >> > >> 'wicket.markup.html.internal.HeaderContainer'). That attribute is
>> >> not
>> >> > >> transient, and gets lazily initialized:
>> >> > >>
>> >> > >> public IHeaderResponse getHeaderResponse() {
>> >> > >> if (this.headerResponse == null)
>> >> > >> {
>> >> > >> headerResponse = new
>> >> > HeaderResponse(getResponse());
>> >> > >> }
>> >> > >> return headerResponse;
>> >> > >> }
>> >> > >>
>> >> > >> I suppose the problem occurs in the following code of the method
>> >> > >> 'onComponentTagBody()':
>> >> > >>
>> >> > >> // Temporarily replace the web response with a
>> String
>> >> > response
>> >> > >> final Response webResponse = this.getResponse();
>> >> > >>
>> >> > >> try
>> >> > >> {
>> >> > >> final StringResponse response = new
>> >> > StringResponse();
>> >> > >>
>> this.getRequestCycle().setResponse(response);
>> >> > >>
>> >> > >> If the headerResponse is not yet initialized at that time, you
>> might
>> >> > >> end-up
>> >> > >> with a reference to a StringResponse because that is what is
>> >> available
>> >> > on
>> >> > >> the requestCycle at that moment.
>> >> > >>
>> >> > >> I found that the StringResponse instance that HttpSessionStore
>> tried
>> >> to
>> >> > >> serialize was the same that was created (temporarily) by the
>> >> > >> HtmlHeaderContainer, and got stored into the 'headerResponse'
>> >> > attribute.
>> >> > >>
>> >> > >> Maybe 'headerResponse' should be transient, or it should be
>> >> initialized
>> >> > >> before the response of the requestCycle is switched to a
>> >> > StringResponse.
>> >> > >>
>> >> > >> Jan.
>> >> > >>
>> >> > >>
>> >> > >> Matej Knopp wrote:
>> >> > >>> It shouldn't implement Serializable. It should never get
>> >> serialized.
>> >> > The
>> >> > >>> problem might be that you hold reference to response somewhere
>> in
>> >> > your
>> >> > >>> components? (just a quess)
>> >> > >>>
>> >> > >>> -Matej
>> >> > >>>
>> >> > >>> Jan Vermeulen wrote:
>> >> > >>>> I changed the sessionStore of my application (using Wicket 2.0)
>> to
>> >> be
>> >> > >>>> 'wicket.protocol.http.HttpSessionStore' i.s.o.
>> >> > >>>> 'wicket.protocol.http.SecondLevelCacheSessionStore' (because I
>> >> use
>> >> > >>>> methods
>> >> > >>>> in the AccessStackPageMap that are not supported in the pageMap
>> of
>> >> > >>>> SecondLevelCacheSessionStore).
>> >> > >>>>
>> >> > >>>> When saving my first page in the HTTPSession, HttpSessionStore
>> >> tries
>> >> > to
>> >> > >>>> serialize it and throws the following exception:
>> >> > >>>>
>> >> > >>>> Caused by: java.io.NotSerializableException:
>> >> > >>>> wicket.response.StringResponse
>> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> >> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
>> >> Source)
>> >> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown
>> Source)
>> >> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>> >> Source)
>> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> >> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
>> >> Source)
>> >> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown
>> Source)
>> >> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>> >> Source)
>> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> >> > >>>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
>> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> >> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
>> >> Source)
>> >> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown
>> Source)
>> >> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>> >> Source)
>> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> >> > >>>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
>> >> > >>>> at
>> >> > >>>> wicket.protocol.http.HttpSessionStore.setAttribute(
>> >> > HttpSessionStore.java:60)
>> >> > >>>> ... 26 more
>> >> > >>>>
>> >> > >>>> Is this a bug in Wicket ? Should StringResponse implement
>> >> > Serializable
>> >> > >>>> ?
>> >> > >>>
>> >> > >>>
>> >> > >>
>> >> > >
>> >> > >
>> >> > >
>> >> >
>> >> > --
>> >> > View this message in context:
>> >> >
>> >>
>> http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6655919
>> >> > Sent from the Wicket - Dev mailing list archive at Nabble.com.
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6659396
>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6660647
Sent from the Wicket - Dev mailing list archive at Nabble.com.
Re: wicket.response.StringResponse not serializable (Wicket 2.0)
Posted by Johan Compagner <jc...@gmail.com>.
Ahh and you are just testing the serializable nature
Because normally the httpsession store doesn't store it directly, but we
have a test there to test the serializeable nature
We should do there detach()
What methods do you need ro the accessstackpagemap??
johan
On 10/5/06, Jan Vermeulen <ja...@isencia.com> wrote:
>
>
> session.touch() puts the page on the PageMap, and the AccessStackPageMap
> calls setAttribute on the HttpSessionStore to save the page on the
> HttpSession. But no detach is done by none of these.
>
>
> Juergen Donnerstag wrote:
> >
> > But headerResponse can be transient as well. It is/should only be used
> > during the render process and doesn't change in between requests.
> >
> > Juergen
> >
> > On 10/5/06, Johan Compagner <jc...@gmail.com> wrote:
> >> no httpsessionstore should detach everything of the page.
> >> Doesn't it do that? Because pages should be stored on disk comletely
> >> detached.
> >>
> >> johan
> >>
> >>
> >> On 10/5/06, Jan Vermeulen <ja...@isencia.com> wrote:
> >> >
> >> >
> >> > It does get cleared when RequestCycle calls detach(), but that
> happens
> >> > AFTER
> >> > the touch() of the session where the page is stored in the
> >> sessionStore.
> >> > So
> >> > the store fails, because HttpSessionStore intents to serialize in its
> >> > setAttribute().
> >> >
> >> > I made 'headerResponse' transient in my workspace, and it solves my
> >> > problem.
> >> > Could this be done in Wicket ? For now, I can't use HttpSessionStore
> >> > without
> >> > this change.
> >> >
> >> > Jan.
> >> >
> >> >
> >> > Matej Knopp wrote:
> >> > >
> >> > > No matter what response is stored in header response, it should be
> >> > > cleared at the end of request - HeaderContainer.onDetach cleans it.
> >> This
> >> > > detach should be done before detaching it. If it's not, then there
> is
> >> a
> >> > > problem.
> >> > >
> >> > > -Matej
> >> > >
> >> > > Jan Vermeulen wrote:
> >> > >> I have been investigating a little, and I thing we`re talking
> about
> >> a
> >> > bug
> >> > >> here.
> >> > >>
> >> > >> The component that is holding a reference to a Response is
> >> > >> 'wicket.markup.html.internal.HtmlHeaderContainer (in its
> superclass
> >> > >> 'wicket.markup.html.internal.HeaderContainer'). That attribute is
> >> not
> >> > >> transient, and gets lazily initialized:
> >> > >>
> >> > >> public IHeaderResponse getHeaderResponse() {
> >> > >> if (this.headerResponse == null)
> >> > >> {
> >> > >> headerResponse = new
> >> > HeaderResponse(getResponse());
> >> > >> }
> >> > >> return headerResponse;
> >> > >> }
> >> > >>
> >> > >> I suppose the problem occurs in the following code of the method
> >> > >> 'onComponentTagBody()':
> >> > >>
> >> > >> // Temporarily replace the web response with a String
> >> > response
> >> > >> final Response webResponse = this.getResponse();
> >> > >>
> >> > >> try
> >> > >> {
> >> > >> final StringResponse response = new
> >> > StringResponse();
> >> > >> this.getRequestCycle().setResponse(response);
> >> > >>
> >> > >> If the headerResponse is not yet initialized at that time, you
> might
> >> > >> end-up
> >> > >> with a reference to a StringResponse because that is what is
> >> available
> >> > on
> >> > >> the requestCycle at that moment.
> >> > >>
> >> > >> I found that the StringResponse instance that HttpSessionStore
> tried
> >> to
> >> > >> serialize was the same that was created (temporarily) by the
> >> > >> HtmlHeaderContainer, and got stored into the 'headerResponse'
> >> > attribute.
> >> > >>
> >> > >> Maybe 'headerResponse' should be transient, or it should be
> >> initialized
> >> > >> before the response of the requestCycle is switched to a
> >> > StringResponse.
> >> > >>
> >> > >> Jan.
> >> > >>
> >> > >>
> >> > >> Matej Knopp wrote:
> >> > >>> It shouldn't implement Serializable. It should never get
> >> serialized.
> >> > The
> >> > >>> problem might be that you hold reference to response somewhere
> in
> >> > your
> >> > >>> components? (just a quess)
> >> > >>>
> >> > >>> -Matej
> >> > >>>
> >> > >>> Jan Vermeulen wrote:
> >> > >>>> I changed the sessionStore of my application (using Wicket 2.0)
> to
> >> be
> >> > >>>> 'wicket.protocol.http.HttpSessionStore' i.s.o.
> >> > >>>> 'wicket.protocol.http.SecondLevelCacheSessionStore' (because I
> >> use
> >> > >>>> methods
> >> > >>>> in the AccessStackPageMap that are not supported in the pageMap
> of
> >> > >>>> SecondLevelCacheSessionStore).
> >> > >>>>
> >> > >>>> When saving my first page in the HTTPSession, HttpSessionStore
> >> tries
> >> > to
> >> > >>>> serialize it and throws the following exception:
> >> > >>>>
> >> > >>>> Caused by: java.io.NotSerializableException:
> >> > >>>> wicket.response.StringResponse
> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
> >> Source)
> >> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> >> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
> >> Source)
> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
> >> Source)
> >> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> >> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
> >> Source)
> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >> > >>>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
> >> Source)
> >> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> >> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
> >> Source)
> >> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >> > >>>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
> >> > >>>> at
> >> > >>>> wicket.protocol.http.HttpSessionStore.setAttribute(
> >> > HttpSessionStore.java:60)
> >> > >>>> ... 26 more
> >> > >>>>
> >> > >>>> Is this a bug in Wicket ? Should StringResponse implement
> >> > Serializable
> >> > >>>> ?
> >> > >>>
> >> > >>>
> >> > >>
> >> > >
> >> > >
> >> > >
> >> >
> >> > --
> >> > View this message in context:
> >> >
> >>
> http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6655919
> >> > Sent from the Wicket - Dev mailing list archive at Nabble.com.
> >> >
> >> >
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6659396
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>
Re: wicket.response.StringResponse not serializable (Wicket 2.0)
Posted by Jan Vermeulen <ja...@isencia.com>.
session.touch() puts the page on the PageMap, and the AccessStackPageMap
calls setAttribute on the HttpSessionStore to save the page on the
HttpSession. But no detach is done by none of these.
Juergen Donnerstag wrote:
>
> But headerResponse can be transient as well. It is/should only be used
> during the render process and doesn't change in between requests.
>
> Juergen
>
> On 10/5/06, Johan Compagner <jc...@gmail.com> wrote:
>> no httpsessionstore should detach everything of the page.
>> Doesn't it do that? Because pages should be stored on disk comletely
>> detached.
>>
>> johan
>>
>>
>> On 10/5/06, Jan Vermeulen <ja...@isencia.com> wrote:
>> >
>> >
>> > It does get cleared when RequestCycle calls detach(), but that happens
>> > AFTER
>> > the touch() of the session where the page is stored in the
>> sessionStore.
>> > So
>> > the store fails, because HttpSessionStore intents to serialize in its
>> > setAttribute().
>> >
>> > I made 'headerResponse' transient in my workspace, and it solves my
>> > problem.
>> > Could this be done in Wicket ? For now, I can't use HttpSessionStore
>> > without
>> > this change.
>> >
>> > Jan.
>> >
>> >
>> > Matej Knopp wrote:
>> > >
>> > > No matter what response is stored in header response, it should be
>> > > cleared at the end of request - HeaderContainer.onDetach cleans it.
>> This
>> > > detach should be done before detaching it. If it's not, then there is
>> a
>> > > problem.
>> > >
>> > > -Matej
>> > >
>> > > Jan Vermeulen wrote:
>> > >> I have been investigating a little, and I thing we`re talking about
>> a
>> > bug
>> > >> here.
>> > >>
>> > >> The component that is holding a reference to a Response is
>> > >> 'wicket.markup.html.internal.HtmlHeaderContainer (in its superclass
>> > >> 'wicket.markup.html.internal.HeaderContainer'). That attribute is
>> not
>> > >> transient, and gets lazily initialized:
>> > >>
>> > >> public IHeaderResponse getHeaderResponse() {
>> > >> if (this.headerResponse == null)
>> > >> {
>> > >> headerResponse = new
>> > HeaderResponse(getResponse());
>> > >> }
>> > >> return headerResponse;
>> > >> }
>> > >>
>> > >> I suppose the problem occurs in the following code of the method
>> > >> 'onComponentTagBody()':
>> > >>
>> > >> // Temporarily replace the web response with a String
>> > response
>> > >> final Response webResponse = this.getResponse();
>> > >>
>> > >> try
>> > >> {
>> > >> final StringResponse response = new
>> > StringResponse();
>> > >> this.getRequestCycle().setResponse(response);
>> > >>
>> > >> If the headerResponse is not yet initialized at that time, you might
>> > >> end-up
>> > >> with a reference to a StringResponse because that is what is
>> available
>> > on
>> > >> the requestCycle at that moment.
>> > >>
>> > >> I found that the StringResponse instance that HttpSessionStore tried
>> to
>> > >> serialize was the same that was created (temporarily) by the
>> > >> HtmlHeaderContainer, and got stored into the 'headerResponse'
>> > attribute.
>> > >>
>> > >> Maybe 'headerResponse' should be transient, or it should be
>> initialized
>> > >> before the response of the requestCycle is switched to a
>> > StringResponse.
>> > >>
>> > >> Jan.
>> > >>
>> > >>
>> > >> Matej Knopp wrote:
>> > >>> It shouldn't implement Serializable. It should never get
>> serialized.
>> > The
>> > >>> problem might be that you hold reference to response somewhere in
>> > your
>> > >>> components? (just a quess)
>> > >>>
>> > >>> -Matej
>> > >>>
>> > >>> Jan Vermeulen wrote:
>> > >>>> I changed the sessionStore of my application (using Wicket 2.0) to
>> be
>> > >>>> 'wicket.protocol.http.HttpSessionStore' i.s.o.
>> > >>>> 'wicket.protocol.http.SecondLevelCacheSessionStore' (because I
>> use
>> > >>>> methods
>> > >>>> in the AccessStackPageMap that are not supported in the pageMap of
>> > >>>> SecondLevelCacheSessionStore).
>> > >>>>
>> > >>>> When saving my first page in the HTTPSession, HttpSessionStore
>> tries
>> > to
>> > >>>> serialize it and throws the following exception:
>> > >>>>
>> > >>>> Caused by: java.io.NotSerializableException:
>> > >>>> wicket.response.StringResponse
>> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
>> Source)
>> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>> Source)
>> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
>> Source)
>> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>> Source)
>> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> > >>>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
>> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown
>> Source)
>> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>> Source)
>> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> > >>>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
>> > >>>> at
>> > >>>> wicket.protocol.http.HttpSessionStore.setAttribute(
>> > HttpSessionStore.java:60)
>> > >>>> ... 26 more
>> > >>>>
>> > >>>> Is this a bug in Wicket ? Should StringResponse implement
>> > Serializable
>> > >>>> ?
>> > >>>
>> > >>>
>> > >>
>> > >
>> > >
>> > >
>> >
>> > --
>> > View this message in context:
>> >
>> http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6655919
>> > Sent from the Wicket - Dev mailing list archive at Nabble.com.
>> >
>> >
>>
>>
>
>
--
View this message in context: http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6659396
Sent from the Wicket - Dev mailing list archive at Nabble.com.
Re: wicket.response.StringResponse not serializable (Wicket 2.0)
Posted by Juergen Donnerstag <ju...@gmail.com>.
But headerResponse can be transient as well. It is/should only be used
during the render process and doesn't change in between requests.
Juergen
On 10/5/06, Johan Compagner <jc...@gmail.com> wrote:
> no httpsessionstore should detach everything of the page.
> Doesn't it do that? Because pages should be stored on disk comletely
> detached.
>
> johan
>
>
> On 10/5/06, Jan Vermeulen <ja...@isencia.com> wrote:
> >
> >
> > It does get cleared when RequestCycle calls detach(), but that happens
> > AFTER
> > the touch() of the session where the page is stored in the sessionStore.
> > So
> > the store fails, because HttpSessionStore intents to serialize in its
> > setAttribute().
> >
> > I made 'headerResponse' transient in my workspace, and it solves my
> > problem.
> > Could this be done in Wicket ? For now, I can't use HttpSessionStore
> > without
> > this change.
> >
> > Jan.
> >
> >
> > Matej Knopp wrote:
> > >
> > > No matter what response is stored in header response, it should be
> > > cleared at the end of request - HeaderContainer.onDetach cleans it. This
> > > detach should be done before detaching it. If it's not, then there is a
> > > problem.
> > >
> > > -Matej
> > >
> > > Jan Vermeulen wrote:
> > >> I have been investigating a little, and I thing we`re talking about a
> > bug
> > >> here.
> > >>
> > >> The component that is holding a reference to a Response is
> > >> 'wicket.markup.html.internal.HtmlHeaderContainer (in its superclass
> > >> 'wicket.markup.html.internal.HeaderContainer'). That attribute is not
> > >> transient, and gets lazily initialized:
> > >>
> > >> public IHeaderResponse getHeaderResponse() {
> > >> if (this.headerResponse == null)
> > >> {
> > >> headerResponse = new
> > HeaderResponse(getResponse());
> > >> }
> > >> return headerResponse;
> > >> }
> > >>
> > >> I suppose the problem occurs in the following code of the method
> > >> 'onComponentTagBody()':
> > >>
> > >> // Temporarily replace the web response with a String
> > response
> > >> final Response webResponse = this.getResponse();
> > >>
> > >> try
> > >> {
> > >> final StringResponse response = new
> > StringResponse();
> > >> this.getRequestCycle().setResponse(response);
> > >>
> > >> If the headerResponse is not yet initialized at that time, you might
> > >> end-up
> > >> with a reference to a StringResponse because that is what is available
> > on
> > >> the requestCycle at that moment.
> > >>
> > >> I found that the StringResponse instance that HttpSessionStore tried to
> > >> serialize was the same that was created (temporarily) by the
> > >> HtmlHeaderContainer, and got stored into the 'headerResponse'
> > attribute.
> > >>
> > >> Maybe 'headerResponse' should be transient, or it should be initialized
> > >> before the response of the requestCycle is switched to a
> > StringResponse.
> > >>
> > >> Jan.
> > >>
> > >>
> > >> Matej Knopp wrote:
> > >>> It shouldn't implement Serializable. It should never get serialized.
> > The
> > >>> problem might be that you hold reference to response somewhere in
> > your
> > >>> components? (just a quess)
> > >>>
> > >>> -Matej
> > >>>
> > >>> Jan Vermeulen wrote:
> > >>>> I changed the sessionStore of my application (using Wicket 2.0) to be
> > >>>> 'wicket.protocol.http.HttpSessionStore' i.s.o.
> > >>>> 'wicket.protocol.http.SecondLevelCacheSessionStore' (because I use
> > >>>> methods
> > >>>> in the AccessStackPageMap that are not supported in the pageMap of
> > >>>> SecondLevelCacheSessionStore).
> > >>>>
> > >>>> When saving my first page in the HTTPSession, HttpSessionStore tries
> > to
> > >>>> serialize it and throws the following exception:
> > >>>>
> > >>>> Caused by: java.io.NotSerializableException:
> > >>>> wicket.response.StringResponse
> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> > >>>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
> > >>>> at
> > >>>> wicket.protocol.http.HttpSessionStore.setAttribute(
> > HttpSessionStore.java:60)
> > >>>> ... 26 more
> > >>>>
> > >>>> Is this a bug in Wicket ? Should StringResponse implement
> > Serializable
> > >>>> ?
> > >>>
> > >>>
> > >>
> > >
> > >
> > >
> >
> > --
> > View this message in context:
> > http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6655919
> > Sent from the Wicket - Dev mailing list archive at Nabble.com.
> >
> >
>
>
Re: wicket.response.StringResponse not serializable (Wicket 2.0)
Posted by Johan Compagner <jc...@gmail.com>.
no httpsessionstore should detach everything of the page.
Doesn't it do that? Because pages should be stored on disk comletely
detached.
johan
On 10/5/06, Jan Vermeulen <ja...@isencia.com> wrote:
>
>
> It does get cleared when RequestCycle calls detach(), but that happens
> AFTER
> the touch() of the session where the page is stored in the sessionStore.
> So
> the store fails, because HttpSessionStore intents to serialize in its
> setAttribute().
>
> I made 'headerResponse' transient in my workspace, and it solves my
> problem.
> Could this be done in Wicket ? For now, I can't use HttpSessionStore
> without
> this change.
>
> Jan.
>
>
> Matej Knopp wrote:
> >
> > No matter what response is stored in header response, it should be
> > cleared at the end of request - HeaderContainer.onDetach cleans it. This
> > detach should be done before detaching it. If it's not, then there is a
> > problem.
> >
> > -Matej
> >
> > Jan Vermeulen wrote:
> >> I have been investigating a little, and I thing we`re talking about a
> bug
> >> here.
> >>
> >> The component that is holding a reference to a Response is
> >> 'wicket.markup.html.internal.HtmlHeaderContainer (in its superclass
> >> 'wicket.markup.html.internal.HeaderContainer'). That attribute is not
> >> transient, and gets lazily initialized:
> >>
> >> public IHeaderResponse getHeaderResponse() {
> >> if (this.headerResponse == null)
> >> {
> >> headerResponse = new
> HeaderResponse(getResponse());
> >> }
> >> return headerResponse;
> >> }
> >>
> >> I suppose the problem occurs in the following code of the method
> >> 'onComponentTagBody()':
> >>
> >> // Temporarily replace the web response with a String
> response
> >> final Response webResponse = this.getResponse();
> >>
> >> try
> >> {
> >> final StringResponse response = new
> StringResponse();
> >> this.getRequestCycle().setResponse(response);
> >>
> >> If the headerResponse is not yet initialized at that time, you might
> >> end-up
> >> with a reference to a StringResponse because that is what is available
> on
> >> the requestCycle at that moment.
> >>
> >> I found that the StringResponse instance that HttpSessionStore tried to
> >> serialize was the same that was created (temporarily) by the
> >> HtmlHeaderContainer, and got stored into the 'headerResponse'
> attribute.
> >>
> >> Maybe 'headerResponse' should be transient, or it should be initialized
> >> before the response of the requestCycle is switched to a
> StringResponse.
> >>
> >> Jan.
> >>
> >>
> >> Matej Knopp wrote:
> >>> It shouldn't implement Serializable. It should never get serialized.
> The
> >>> problem might be that you hold reference to response somewhere in
> your
> >>> components? (just a quess)
> >>>
> >>> -Matej
> >>>
> >>> Jan Vermeulen wrote:
> >>>> I changed the sessionStore of my application (using Wicket 2.0) to be
> >>>> 'wicket.protocol.http.HttpSessionStore' i.s.o.
> >>>> 'wicket.protocol.http.SecondLevelCacheSessionStore' (because I use
> >>>> methods
> >>>> in the AccessStackPageMap that are not supported in the pageMap of
> >>>> SecondLevelCacheSessionStore).
> >>>>
> >>>> When saving my first page in the HTTPSession, HttpSessionStore tries
> to
> >>>> serialize it and throws the following exception:
> >>>>
> >>>> Caused by: java.io.NotSerializableException:
> >>>> wicket.response.StringResponse
> >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
> >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
> >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
> >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
> >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >>>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
> >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
> >>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> >>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
> >>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> >>>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
> >>>> at
> >>>> wicket.protocol.http.HttpSessionStore.setAttribute(
> HttpSessionStore.java:60)
> >>>> ... 26 more
> >>>>
> >>>> Is this a bug in Wicket ? Should StringResponse implement
> Serializable
> >>>> ?
> >>>
> >>>
> >>
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6655919
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>
Re: wicket.response.StringResponse not serializable (Wicket 2.0)
Posted by Jan Vermeulen <ja...@isencia.com>.
It does get cleared when RequestCycle calls detach(), but that happens AFTER
the touch() of the session where the page is stored in the sessionStore. So
the store fails, because HttpSessionStore intents to serialize in its
setAttribute().
I made 'headerResponse' transient in my workspace, and it solves my problem.
Could this be done in Wicket ? For now, I can't use HttpSessionStore without
this change.
Jan.
Matej Knopp wrote:
>
> No matter what response is stored in header response, it should be
> cleared at the end of request - HeaderContainer.onDetach cleans it. This
> detach should be done before detaching it. If it's not, then there is a
> problem.
>
> -Matej
>
> Jan Vermeulen wrote:
>> I have been investigating a little, and I thing we`re talking about a bug
>> here.
>>
>> The component that is holding a reference to a Response is
>> 'wicket.markup.html.internal.HtmlHeaderContainer (in its superclass
>> 'wicket.markup.html.internal.HeaderContainer'). That attribute is not
>> transient, and gets lazily initialized:
>>
>> public IHeaderResponse getHeaderResponse() {
>> if (this.headerResponse == null)
>> {
>> headerResponse = new HeaderResponse(getResponse());
>> }
>> return headerResponse;
>> }
>>
>> I suppose the problem occurs in the following code of the method
>> 'onComponentTagBody()':
>>
>> // Temporarily replace the web response with a String response
>> final Response webResponse = this.getResponse();
>>
>> try
>> {
>> final StringResponse response = new StringResponse();
>> this.getRequestCycle().setResponse(response);
>>
>> If the headerResponse is not yet initialized at that time, you might
>> end-up
>> with a reference to a StringResponse because that is what is available on
>> the requestCycle at that moment.
>>
>> I found that the StringResponse instance that HttpSessionStore tried to
>> serialize was the same that was created (temporarily) by the
>> HtmlHeaderContainer, and got stored into the 'headerResponse' attribute.
>>
>> Maybe 'headerResponse' should be transient, or it should be initialized
>> before the response of the requestCycle is switched to a StringResponse.
>>
>> Jan.
>>
>>
>> Matej Knopp wrote:
>>> It shouldn't implement Serializable. It should never get serialized. The
>>> problem might be that you hold reference to response somewhere in your
>>> components? (just a quess)
>>>
>>> -Matej
>>>
>>> Jan Vermeulen wrote:
>>>> I changed the sessionStore of my application (using Wicket 2.0) to be
>>>> 'wicket.protocol.http.HttpSessionStore' i.s.o.
>>>> 'wicket.protocol.http.SecondLevelCacheSessionStore' (because I use
>>>> methods
>>>> in the AccessStackPageMap that are not supported in the pageMap of
>>>> SecondLevelCacheSessionStore).
>>>>
>>>> When saving my first page in the HTTPSession, HttpSessionStore tries to
>>>> serialize it and throws the following exception:
>>>>
>>>> Caused by: java.io.NotSerializableException:
>>>> wicket.response.StringResponse
>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
>>>> at
>>>> wicket.protocol.http.HttpSessionStore.setAttribute(HttpSessionStore.java:60)
>>>> ... 26 more
>>>>
>>>> Is this a bug in Wicket ? Should StringResponse implement Serializable
>>>> ?
>>>
>>>
>>
>
>
>
--
View this message in context: http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6655919
Sent from the Wicket - Dev mailing list archive at Nabble.com.
Re: wicket.response.StringResponse not serializable (Wicket 2.0)
Posted by Matej Knopp <ma...@knopp.sk>.
No matter what response is stored in header response, it should be
cleared at the end of request - HeaderContainer.onDetach cleans it. This
detach should be done before detaching it. If it's not, then there is a
problem.
-Matej
Jan Vermeulen wrote:
> I have been investigating a little, and I thing we`re talking about a bug
> here.
>
> The component that is holding a reference to a Response is
> 'wicket.markup.html.internal.HtmlHeaderContainer (in its superclass
> 'wicket.markup.html.internal.HeaderContainer'). That attribute is not
> transient, and gets lazily initialized:
>
> public IHeaderResponse getHeaderResponse() {
> if (this.headerResponse == null)
> {
> headerResponse = new HeaderResponse(getResponse());
> }
> return headerResponse;
> }
>
> I suppose the problem occurs in the following code of the method
> 'onComponentTagBody()':
>
> // Temporarily replace the web response with a String response
> final Response webResponse = this.getResponse();
>
> try
> {
> final StringResponse response = new StringResponse();
> this.getRequestCycle().setResponse(response);
>
> If the headerResponse is not yet initialized at that time, you might end-up
> with a reference to a StringResponse because that is what is available on
> the requestCycle at that moment.
>
> I found that the StringResponse instance that HttpSessionStore tried to
> serialize was the same that was created (temporarily) by the
> HtmlHeaderContainer, and got stored into the 'headerResponse' attribute.
>
> Maybe 'headerResponse' should be transient, or it should be initialized
> before the response of the requestCycle is switched to a StringResponse.
>
> Jan.
>
>
> Matej Knopp wrote:
>> It shouldn't implement Serializable. It should never get serialized. The
>> problem might be that you hold reference to response somewhere in your
>> components? (just a quess)
>>
>> -Matej
>>
>> Jan Vermeulen wrote:
>>> I changed the sessionStore of my application (using Wicket 2.0) to be
>>> 'wicket.protocol.http.HttpSessionStore' i.s.o.
>>> 'wicket.protocol.http.SecondLevelCacheSessionStore' (because I use
>>> methods
>>> in the AccessStackPageMap that are not supported in the pageMap of
>>> SecondLevelCacheSessionStore).
>>>
>>> When saving my first page in the HTTPSession, HttpSessionStore tries to
>>> serialize it and throws the following exception:
>>>
>>> Caused by: java.io.NotSerializableException:
>>> wicket.response.StringResponse
>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
>>> at
>>> wicket.protocol.http.HttpSessionStore.setAttribute(HttpSessionStore.java:60)
>>> ... 26 more
>>>
>>> Is this a bug in Wicket ? Should StringResponse implement Serializable ?
>>
>>
>
Re: wicket.response.StringResponse not serializable (Wicket 2.0)
Posted by Jan Vermeulen <ja...@isencia.com>.
I have been investigating a little, and I thing we`re talking about a bug
here.
The component that is holding a reference to a Response is
'wicket.markup.html.internal.HtmlHeaderContainer (in its superclass
'wicket.markup.html.internal.HeaderContainer'). That attribute is not
transient, and gets lazily initialized:
public IHeaderResponse getHeaderResponse() {
if (this.headerResponse == null)
{
headerResponse = new HeaderResponse(getResponse());
}
return headerResponse;
}
I suppose the problem occurs in the following code of the method
'onComponentTagBody()':
// Temporarily replace the web response with a String response
final Response webResponse = this.getResponse();
try
{
final StringResponse response = new StringResponse();
this.getRequestCycle().setResponse(response);
If the headerResponse is not yet initialized at that time, you might end-up
with a reference to a StringResponse because that is what is available on
the requestCycle at that moment.
I found that the StringResponse instance that HttpSessionStore tried to
serialize was the same that was created (temporarily) by the
HtmlHeaderContainer, and got stored into the 'headerResponse' attribute.
Maybe 'headerResponse' should be transient, or it should be initialized
before the response of the requestCycle is switched to a StringResponse.
Jan.
Matej Knopp wrote:
>
> It shouldn't implement Serializable. It should never get serialized. The
> problem might be that you hold reference to response somewhere in your
> components? (just a quess)
>
> -Matej
>
> Jan Vermeulen wrote:
>> I changed the sessionStore of my application (using Wicket 2.0) to be
>> 'wicket.protocol.http.HttpSessionStore' i.s.o.
>> 'wicket.protocol.http.SecondLevelCacheSessionStore' (because I use
>> methods
>> in the AccessStackPageMap that are not supported in the pageMap of
>> SecondLevelCacheSessionStore).
>>
>> When saving my first page in the HTTPSession, HttpSessionStore tries to
>> serialize it and throws the following exception:
>>
>> Caused by: java.io.NotSerializableException:
>> wicket.response.StringResponse
>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
>> at
>> wicket.protocol.http.HttpSessionStore.setAttribute(HttpSessionStore.java:60)
>> ... 26 more
>>
>> Is this a bug in Wicket ? Should StringResponse implement Serializable ?
>
>
>
--
View this message in context: http://www.nabble.com/wicket.response.StringResponse-not-serializable-%28Wicket-2.0%29-tf2382604.html#a6646101
Sent from the Wicket - Dev mailing list archive at Nabble.com.
Re: wicket.response.StringResponse not serializable (Wicket 2.0)
Posted by Matej Knopp <ma...@knopp.sk>.
It shouldn't implement Serializable. It should never get serialized. The
problem might be that you hold reference to response somewhere in your
components? (just a quess)
-Matej
Jan Vermeulen wrote:
> I changed the sessionStore of my application (using Wicket 2.0) to be
> 'wicket.protocol.http.HttpSessionStore' i.s.o.
> 'wicket.protocol.http.SecondLevelCacheSessionStore' (because I use methods
> in the AccessStackPageMap that are not supported in the pageMap of
> SecondLevelCacheSessionStore).
>
> When saving my first page in the HTTPSession, HttpSessionStore tries to
> serialize it and throws the following exception:
>
> Caused by: java.io.NotSerializableException: wicket.response.StringResponse
> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> at java.io.ObjectOutputStream.writeArray(Unknown Source)
> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> at java.io.ObjectOutputStream.writeObject(Unknown Source)
> at
> wicket.protocol.http.HttpSessionStore.setAttribute(HttpSessionStore.java:60)
> ... 26 more
>
> Is this a bug in Wicket ? Should StringResponse implement Serializable ?