You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brian Relph <re...@gmail.com> on 2008/02/14 17:38:28 UTC

serializable and exceptions

Hey everyone, I seem to be coming across two issues when running multiple
jvms with session sharing ... i have not run into this during my previous
testing, since i was not worried about a high-availability environment, and
did not test inside a cluster...

Anyways, i receive this exception when using the ModelDriven interface (the
Accounts object is my model):

[2/14/08 3:35:04:737 GMT] 00000052 HttpSessDRSBu E storeObject: Caught
Exception while trying to serialize. Stack trace:
java.io.NotSerializableException:
com.cerner.healthe.admin.portlet.model.Accounts
I did not really investigate how the ModelDriven interface works, it just
made my ui code cleaner, and allowed me to group a bunch of fields outside
of my action.  Anyways, i was wondering if changing the ModelDriven
interface to require the object to implement Serializable would make sense?

Because of this serializable exception, my exception interceptor forwards me
to a page, and then i display the exception.  At this point, i get another
similar exception:

[2/14/08 16:16:48:936 GMT] 00000029 HttpSessDRSBu E   storeObject: Caught
Exception while trying to serialize. Stack trace:
java.io.NotSerializableException:
com.opensymphony.xwork2.interceptor.ExceptionHolder

I see that the xwork2 interceptor implement the Serializable interface, but
that particular class does not.  Is xwork2 code part of the struts2 code
base, i.e., is this the right place to post for these exceptions?

Finally (this kinda has a bunch of things all wrapped into one), is there
any easier way to increase the logging of the exception interceptor,
besides re-defining the default interceptor stack?  I tried to just
re-define the interceptor, i also tried to just set the parameters, but
it did not seem to work unless i configured my own stack in this way:

<interceptors>

<interceptor-stack name="defaultLoggingStack">
  <interceptor-ref name="exception">
    <param name="logEnabled">true</param>
    <param name="logLevel">warn</param>
  </interceptor-ref>
  <interceptor-ref name="alias" />
  <interceptor-ref name="servlet-config" />
  <interceptor-ref name="prepare" />
  <interceptor-ref name="i18n" />
  <interceptor-ref name="chain" />
  <interceptor-ref name="debugging" />
  <interceptor-ref name="profiling" />
  <interceptor-ref name="scoped-model-driven" />
  <interceptor-ref name="model-driven" />
  <interceptor-ref name="fileUpload" />
  <interceptor-ref name="checkbox" />
  <interceptor-ref name="static-params" />
  <interceptor-ref name="params" />
  <interceptor-ref name="conversionError" />
  <interceptor-ref name="validation">
    <param name="excludeMethods">
      input,back,cancel,browse
    </param>
  </interceptor-ref>
  <interceptor-ref name="workflow">
    <param name="excludeMethods">
      input,back,cancel,browse
    </param>
  </interceptor-ref>
</interceptor-stack>

<!-- Default stack for operating in portlet environment -->
<interceptor-stack name="portletDefaultLoggingStack">
  <interceptor-ref name="portletState" />
  <interceptor-ref name="defaultLoggingStack" />
  <interceptor-ref name="portletAware" />
</interceptor-stack>

</interceptors>
-- 
Brian

Re: serializable and exceptions

Posted by Randy Burgess <RB...@nuvox.com>.
I wonder if making your object implement serializable will have any affect
on the Xwork object. Have you tried to see what happens?

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: Brian Relph <re...@gmail.com>
> Reply-To: Struts Users Mailing List <us...@struts.apache.org>
> Date: Thu, 14 Feb 2008 14:27:19 -0600
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: Re: serializable and exceptions
> 
> Yes, for my own objects, i am going to implement the serializable interface,
> however, the xwork class, even if i were to rewrite/replace it, i would also
> have to rewrite the interceptor to use the new object ...
> 
> 
> On 2/14/08, Randy Burgess <RB...@nuvox.com> wrote:
>> 
>> That would be the first thing I would do and generate a serialVersionUID
>> for
>> the pojo.
>> 
>> Regards,
>> Randy Burgess
>> Sr. Web Applications Developer
>> Nuvox Communications
>> 
>> 
>> 
>>> From: Brian Relph <re...@gmail.com>
>>> Reply-To: Struts Users Mailing List <us...@struts.apache.org>
>>> Date: Thu, 14 Feb 2008 10:38:28 -0600
>>> To: Struts Users Mailing List <us...@struts.apache.org>
>>> Subject: serializable and exceptions
>>> 
>>> Hey everyone, I seem to be coming across two issues when running
>> multiple
>>> jvms with session sharing ... i have not run into this during my
>> previous
>>> testing, since i was not worried about a high-availability environment,
>> and
>>> did not test inside a cluster...
>>> 
>>> Anyways, i receive this exception when using the ModelDriven interface
>> (the
>>> Accounts object is my model):
>>> 
>>> [2/14/08 3:35:04:737 GMT] 00000052 HttpSessDRSBu E storeObject: Caught
>>> Exception while trying to serialize. Stack trace:
>>> java.io.NotSerializableException:
>>> com.cerner.healthe.admin.portlet.model.Accounts
>>> I did not really investigate how the ModelDriven interface works, it
>> just
>>> made my ui code cleaner, and allowed me to group a bunch of fields
>> outside
>>> of my action.  Anyways, i was wondering if changing the ModelDriven
>>> interface to require the object to implement Serializable would make
>> sense?
>>> 
>>> Because of this serializable exception, my exception interceptor
>> forwards me
>>> to a page, and then i display the exception.  At this point, i get
>> another
>>> similar exception:
>>> 
>>> [2/14/08 16:16:48:936 GMT] 00000029 HttpSessDRSBu E   storeObject:
>> Caught
>>> Exception while trying to serialize. Stack trace:
>>> java.io.NotSerializableException:
>>> com.opensymphony.xwork2.interceptor.ExceptionHolder
>>> 
>>> I see that the xwork2 interceptor implement the Serializable interface,
>> but
>>> that particular class does not.  Is xwork2 code part of the struts2 code
>>> base, i.e., is this the right place to post for these exceptions?
>>> 
>>> Finally (this kinda has a bunch of things all wrapped into one), is
>> there
>>> any easier way to increase the logging of the exception interceptor,
>>> besides re-defining the default interceptor stack?  I tried to just
>>> re-define the interceptor, i also tried to just set the parameters, but
>>> it did not seem to work unless i configured my own stack in this way:
>>> 
>>> <interceptors>
>>> 
>>> <interceptor-stack name="defaultLoggingStack">
>>>   <interceptor-ref name="exception">
>>>     <param name="logEnabled">true</param>
>>>     <param name="logLevel">warn</param>
>>>   </interceptor-ref>
>>>   <interceptor-ref name="alias" />
>>>   <interceptor-ref name="servlet-config" />
>>>   <interceptor-ref name="prepare" />
>>>   <interceptor-ref name="i18n" />
>>>   <interceptor-ref name="chain" />
>>>   <interceptor-ref name="debugging" />
>>>   <interceptor-ref name="profiling" />
>>>   <interceptor-ref name="scoped-model-driven" />
>>>   <interceptor-ref name="model-driven" />
>>>   <interceptor-ref name="fileUpload" />
>>>   <interceptor-ref name="checkbox" />
>>>   <interceptor-ref name="static-params" />
>>>   <interceptor-ref name="params" />
>>>   <interceptor-ref name="conversionError" />
>>>   <interceptor-ref name="validation">
>>>     <param name="excludeMethods">
>>>       input,back,cancel,browse
>>>     </param>
>>>   </interceptor-ref>
>>>   <interceptor-ref name="workflow">
>>>     <param name="excludeMethods">
>>>       input,back,cancel,browse
>>>     </param>
>>>   </interceptor-ref>
>>> </interceptor-stack>
>>> 
>>> <!-- Default stack for operating in portlet environment -->
>>> <interceptor-stack name="portletDefaultLoggingStack">
>>>   <interceptor-ref name="portletState" />
>>>   <interceptor-ref name="defaultLoggingStack" />
>>>   <interceptor-ref name="portletAware" />
>>> </interceptor-stack>
>>> 
>>> </interceptors>
>>> --
>>> Brian
>> 
>> 
>> 
>> This email and any attachments ("Message") may contain legally privileged
>> and/or confidential information.  If you are not the addressee, or if this
>> Message has been addressed to you in error, you are not authorized to read,
>> copy, or distribute it, and we ask that you please delete it (including all
>> copies) and notify the sender by return email.  Delivery of this Message to
>> any person other than the intended recipient(s) shall not be deemed a waiver
>> of confidentiality and/or a privilege.
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
> 
> 
> -- 
> Brian



This email and any attachments ("Message") may contain legally privileged and/or confidential information.  If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email.  Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: serializable and exceptions

Posted by Brian Relph <re...@gmail.com>.
Yes, for my own objects, i am going to implement the serializable interface,
however, the xwork class, even if i were to rewrite/replace it, i would also
have to rewrite the interceptor to use the new object ...


On 2/14/08, Randy Burgess <RB...@nuvox.com> wrote:
>
> That would be the first thing I would do and generate a serialVersionUID
> for
> the pojo.
>
> Regards,
> Randy Burgess
> Sr. Web Applications Developer
> Nuvox Communications
>
>
>
> > From: Brian Relph <re...@gmail.com>
> > Reply-To: Struts Users Mailing List <us...@struts.apache.org>
> > Date: Thu, 14 Feb 2008 10:38:28 -0600
> > To: Struts Users Mailing List <us...@struts.apache.org>
> > Subject: serializable and exceptions
> >
> > Hey everyone, I seem to be coming across two issues when running
> multiple
> > jvms with session sharing ... i have not run into this during my
> previous
> > testing, since i was not worried about a high-availability environment,
> and
> > did not test inside a cluster...
> >
> > Anyways, i receive this exception when using the ModelDriven interface
> (the
> > Accounts object is my model):
> >
> > [2/14/08 3:35:04:737 GMT] 00000052 HttpSessDRSBu E storeObject: Caught
> > Exception while trying to serialize. Stack trace:
> > java.io.NotSerializableException:
> > com.cerner.healthe.admin.portlet.model.Accounts
> > I did not really investigate how the ModelDriven interface works, it
> just
> > made my ui code cleaner, and allowed me to group a bunch of fields
> outside
> > of my action.  Anyways, i was wondering if changing the ModelDriven
> > interface to require the object to implement Serializable would make
> sense?
> >
> > Because of this serializable exception, my exception interceptor
> forwards me
> > to a page, and then i display the exception.  At this point, i get
> another
> > similar exception:
> >
> > [2/14/08 16:16:48:936 GMT] 00000029 HttpSessDRSBu E   storeObject:
> Caught
> > Exception while trying to serialize. Stack trace:
> > java.io.NotSerializableException:
> > com.opensymphony.xwork2.interceptor.ExceptionHolder
> >
> > I see that the xwork2 interceptor implement the Serializable interface,
> but
> > that particular class does not.  Is xwork2 code part of the struts2 code
> > base, i.e., is this the right place to post for these exceptions?
> >
> > Finally (this kinda has a bunch of things all wrapped into one), is
> there
> > any easier way to increase the logging of the exception interceptor,
> > besides re-defining the default interceptor stack?  I tried to just
> > re-define the interceptor, i also tried to just set the parameters, but
> > it did not seem to work unless i configured my own stack in this way:
> >
> > <interceptors>
> >
> > <interceptor-stack name="defaultLoggingStack">
> >   <interceptor-ref name="exception">
> >     <param name="logEnabled">true</param>
> >     <param name="logLevel">warn</param>
> >   </interceptor-ref>
> >   <interceptor-ref name="alias" />
> >   <interceptor-ref name="servlet-config" />
> >   <interceptor-ref name="prepare" />
> >   <interceptor-ref name="i18n" />
> >   <interceptor-ref name="chain" />
> >   <interceptor-ref name="debugging" />
> >   <interceptor-ref name="profiling" />
> >   <interceptor-ref name="scoped-model-driven" />
> >   <interceptor-ref name="model-driven" />
> >   <interceptor-ref name="fileUpload" />
> >   <interceptor-ref name="checkbox" />
> >   <interceptor-ref name="static-params" />
> >   <interceptor-ref name="params" />
> >   <interceptor-ref name="conversionError" />
> >   <interceptor-ref name="validation">
> >     <param name="excludeMethods">
> >       input,back,cancel,browse
> >     </param>
> >   </interceptor-ref>
> >   <interceptor-ref name="workflow">
> >     <param name="excludeMethods">
> >       input,back,cancel,browse
> >     </param>
> >   </interceptor-ref>
> > </interceptor-stack>
> >
> > <!-- Default stack for operating in portlet environment -->
> > <interceptor-stack name="portletDefaultLoggingStack">
> >   <interceptor-ref name="portletState" />
> >   <interceptor-ref name="defaultLoggingStack" />
> >   <interceptor-ref name="portletAware" />
> > </interceptor-stack>
> >
> > </interceptors>
> > --
> > Brian
>
>
>
> This email and any attachments ("Message") may contain legally privileged
> and/or confidential information.  If you are not the addressee, or if this
> Message has been addressed to you in error, you are not authorized to read,
> copy, or distribute it, and we ask that you please delete it (including all
> copies) and notify the sender by return email.  Delivery of this Message to
> any person other than the intended recipient(s) shall not be deemed a waiver
> of confidentiality and/or a privilege.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Brian

Re: serializable and exceptions

Posted by Randy Burgess <RB...@nuvox.com>.
That would be the first thing I would do and generate a serialVersionUID for
the pojo.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: Brian Relph <re...@gmail.com>
> Reply-To: Struts Users Mailing List <us...@struts.apache.org>
> Date: Thu, 14 Feb 2008 10:38:28 -0600
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: serializable and exceptions
> 
> Hey everyone, I seem to be coming across two issues when running multiple
> jvms with session sharing ... i have not run into this during my previous
> testing, since i was not worried about a high-availability environment, and
> did not test inside a cluster...
> 
> Anyways, i receive this exception when using the ModelDriven interface (the
> Accounts object is my model):
> 
> [2/14/08 3:35:04:737 GMT] 00000052 HttpSessDRSBu E storeObject: Caught
> Exception while trying to serialize. Stack trace:
> java.io.NotSerializableException:
> com.cerner.healthe.admin.portlet.model.Accounts
> I did not really investigate how the ModelDriven interface works, it just
> made my ui code cleaner, and allowed me to group a bunch of fields outside
> of my action.  Anyways, i was wondering if changing the ModelDriven
> interface to require the object to implement Serializable would make sense?
> 
> Because of this serializable exception, my exception interceptor forwards me
> to a page, and then i display the exception.  At this point, i get another
> similar exception:
> 
> [2/14/08 16:16:48:936 GMT] 00000029 HttpSessDRSBu E   storeObject: Caught
> Exception while trying to serialize. Stack trace:
> java.io.NotSerializableException:
> com.opensymphony.xwork2.interceptor.ExceptionHolder
> 
> I see that the xwork2 interceptor implement the Serializable interface, but
> that particular class does not.  Is xwork2 code part of the struts2 code
> base, i.e., is this the right place to post for these exceptions?
> 
> Finally (this kinda has a bunch of things all wrapped into one), is there
> any easier way to increase the logging of the exception interceptor,
> besides re-defining the default interceptor stack?  I tried to just
> re-define the interceptor, i also tried to just set the parameters, but
> it did not seem to work unless i configured my own stack in this way:
> 
> <interceptors>
> 
> <interceptor-stack name="defaultLoggingStack">
>   <interceptor-ref name="exception">
>     <param name="logEnabled">true</param>
>     <param name="logLevel">warn</param>
>   </interceptor-ref>
>   <interceptor-ref name="alias" />
>   <interceptor-ref name="servlet-config" />
>   <interceptor-ref name="prepare" />
>   <interceptor-ref name="i18n" />
>   <interceptor-ref name="chain" />
>   <interceptor-ref name="debugging" />
>   <interceptor-ref name="profiling" />
>   <interceptor-ref name="scoped-model-driven" />
>   <interceptor-ref name="model-driven" />
>   <interceptor-ref name="fileUpload" />
>   <interceptor-ref name="checkbox" />
>   <interceptor-ref name="static-params" />
>   <interceptor-ref name="params" />
>   <interceptor-ref name="conversionError" />
>   <interceptor-ref name="validation">
>     <param name="excludeMethods">
>       input,back,cancel,browse
>     </param>
>   </interceptor-ref>
>   <interceptor-ref name="workflow">
>     <param name="excludeMethods">
>       input,back,cancel,browse
>     </param>
>   </interceptor-ref>
> </interceptor-stack>
> 
> <!-- Default stack for operating in portlet environment -->
> <interceptor-stack name="portletDefaultLoggingStack">
>   <interceptor-ref name="portletState" />
>   <interceptor-ref name="defaultLoggingStack" />
>   <interceptor-ref name="portletAware" />
> </interceptor-stack>
> 
> </interceptors>
> -- 
> Brian



This email and any attachments ("Message") may contain legally privileged and/or confidential information.  If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email.  Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org