You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Yu...@muranosoft.com on 2006/03/30 16:27:49 UTC

NotSerializableException during saveState

Hi, All

I'm using MyFaces component saveState and trys to save whole bean, so I
implemented interface StateHolder for this bean as by manual, but I still
get NotserializableException for my request scope bean.

Could you please clarify this moment for me, please? I'm using
SAVE_STATE_METHOD = client

 

As manual I can implements one of these interfaces StateHolder or
Serializable, but with StateHolder it isn't works, why?

 

Thanks,

Yura.


RE: NotSerializableException during saveState

Posted by "Yura.Tkachenko" <Yu...@muranosoft.com>.
Thanks, Adam

Could you please explain me some more details and specific circumstances for
StateHolder?

Yura.



-----Original Message-----
From: Adam Winer [mailto:awiner@gmail.com] 
Sent: Friday, March 31, 2006 2:23 AM
To: MyFaces Discussion
Subject: Re: NotSerializableException during saveState

I'd recommend implementing Serializable.  StateHolder is only
relevant in specific circumstances, and if you're not the sort who
likes memorizing the JSF spec in detail, you'll be much better
of just always implementing Serializable.  All scenarios that support
StateHolder also support Serializable, whereas the converse is not
true.

-- Adam Winer


On 3/30/06, Yura.Tkachenko <Yu...@muranosoft.com> wrote:
> One little remark, when I trys to implement Serializable instead of
> StateHolder everything works, but I want to know is this my issue in bean
> with StateHolder or not?
>
> Thanks,
> Yura.
>
> -----Original Message-----
> From: Mike Kienenberger [mailto:mkienenb@gmail.com]
> Sent: Thursday, March 30, 2006 6:54 PM
> To: MyFaces Discussion
> Subject: Re: NotSerializableException during saveState
>
> On 3/30/06, Yura.Tkachenko@muranosoft.com
> > javax.faces.FacesException:
> > java.io.NotSerializableException:
> > com.nsite.wsbuilder.TableFiltersBean
> >
> > at
> > org.apache.myfaces.util.StateUtils.encode64(StateUtils.java:43)
>
> Is com.nsite.wsbuilder.TableFiltersBean the bean you have implemented
> StateHolder on?   If not, that's the problem.   If so, you'll probably
> need to post the bean code, but it doesn't look like it implements
> StateHolder from the stacktrace.
>
>


Re: NotSerializableException during saveState

Posted by Adam Winer <aw...@gmail.com>.
I'd recommend implementing Serializable.  StateHolder is only
relevant in specific circumstances, and if you're not the sort who
likes memorizing the JSF spec in detail, you'll be much better
of just always implementing Serializable.  All scenarios that support
StateHolder also support Serializable, whereas the converse is not
true.

-- Adam Winer


On 3/30/06, Yura.Tkachenko <Yu...@muranosoft.com> wrote:
> One little remark, when I trys to implement Serializable instead of
> StateHolder everything works, but I want to know is this my issue in bean
> with StateHolder or not?
>
> Thanks,
> Yura.
>
> -----Original Message-----
> From: Mike Kienenberger [mailto:mkienenb@gmail.com]
> Sent: Thursday, March 30, 2006 6:54 PM
> To: MyFaces Discussion
> Subject: Re: NotSerializableException during saveState
>
> On 3/30/06, Yura.Tkachenko@muranosoft.com
> > javax.faces.FacesException:
> > java.io.NotSerializableException:
> > com.nsite.wsbuilder.TableFiltersBean
> >
> > at
> > org.apache.myfaces.util.StateUtils.encode64(StateUtils.java:43)
>
> Is com.nsite.wsbuilder.TableFiltersBean the bean you have implemented
> StateHolder on?   If not, that's the problem.   If so, you'll probably
> need to post the bean code, but it doesn't look like it implements
> StateHolder from the stacktrace.
>
>

RE: NotSerializableException during saveState

Posted by "Yura.Tkachenko" <Yu...@muranosoft.com>.
Hi, Mike

My bean com.nsite.wsbuilder.TableFiltersBean (request scope bean) this bean
implemented StateHolder interface, I implements:

saveState, restoreState, isTransient () {return false;},
setTransient(Boolean b) { } methods.

Thanks for you help,
Yura.

-----Original Message-----
From: Mike Kienenberger [mailto:mkienenb@gmail.com] 
Sent: Thursday, March 30, 2006 6:54 PM
To: MyFaces Discussion
Subject: Re: NotSerializableException during saveState

On 3/30/06, Yura.Tkachenko@muranosoft.com
> javax.faces.FacesException:
> java.io.NotSerializableException:
> com.nsite.wsbuilder.TableFiltersBean
>
> at
> org.apache.myfaces.util.StateUtils.encode64(StateUtils.java:43)

Is com.nsite.wsbuilder.TableFiltersBean the bean you have implemented
StateHolder on?   If not, that's the problem.   If so, you'll probably
need to post the bean code, but it doesn't look like it implements
StateHolder from the stacktrace.


RE: NotSerializableException during saveState

Posted by "Yura.Tkachenko" <Yu...@muranosoft.com>.
One little remark, when I trys to implement Serializable instead of
StateHolder everything works, but I want to know is this my issue in bean
with StateHolder or not?

Thanks,
Yura.

-----Original Message-----
From: Mike Kienenberger [mailto:mkienenb@gmail.com] 
Sent: Thursday, March 30, 2006 6:54 PM
To: MyFaces Discussion
Subject: Re: NotSerializableException during saveState

On 3/30/06, Yura.Tkachenko@muranosoft.com
> javax.faces.FacesException:
> java.io.NotSerializableException:
> com.nsite.wsbuilder.TableFiltersBean
>
> at
> org.apache.myfaces.util.StateUtils.encode64(StateUtils.java:43)

Is com.nsite.wsbuilder.TableFiltersBean the bean you have implemented
StateHolder on?   If not, that's the problem.   If so, you'll probably
need to post the bean code, but it doesn't look like it implements
StateHolder from the stacktrace.


Re: NotSerializableException during saveState

Posted by Mike Kienenberger <mk...@gmail.com>.
On 3/30/06, Yura.Tkachenko@muranosoft.com
> javax.faces.FacesException:
> java.io.NotSerializableException:
> com.nsite.wsbuilder.TableFiltersBean
>
> at
> org.apache.myfaces.util.StateUtils.encode64(StateUtils.java:43)

Is com.nsite.wsbuilder.TableFiltersBean the bean you have implemented
StateHolder on?   If not, that's the problem.   If so, you'll probably
need to post the bean code, but it doesn't look like it implements
StateHolder from the stacktrace.

RE: NotSerializableException during saveState

Posted by Yu...@muranosoft.com.
Here is:

javax.faces.FacesException: java.io.NotSerializableException:
com.nsite.wsbuilder.TableFiltersBean 

at org.apache.myfaces.util.StateUtils.encode64(StateUtils.java:43) 

at
org.apache.myfaces.renderkit.html.HtmlResponseStateManager.writeState(HtmlRe
sponseStateManager.java:104) 

at
org.apache.myfaces.application.jsp.JspStateManagerImpl.writeState(JspStateMa
nagerImpl.java:268) 

at org.apache.myfaces.taglib.core.ViewTag.doAfterBody(ViewTag.java:160) 

at
org.apache.jsp.c.appdesigner.wsbuilder.SelectionLookupTableFilters_jsp._jspx
_meth_f_view_0(SelectionLookupTableFilters_jsp.java:207) 

at
org.apache.jsp.c.appdesigner.wsbuilder.SelectionLookupTableFilters_jsp._jspS
ervice(SelectionLookupTableFilters_jsp.java:154) 

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) 

at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) 

at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
98) 

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) 

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) 

at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) 

at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:252) 

at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173) 

at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:672) 

at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDis
patcher.java:463) 

at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:398) 

at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:301) 

at
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(Servl
etExternalContextImpl.java:415) 

at
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHand
lerImpl.java:234) 

at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300)


at javax.faces.webapp.FacesServlet.service(FacesServlet.java:95) 

at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:252) 

at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173) 

at com.nsite.filter.GZIPFilter.doFilter(GZIPFilter.java:28) 

at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202) 

at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173) 

at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterI
nternal(OpenSessionInViewFilter.java:174) 

at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestF
ilter.java:76) 

at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202) 

at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173) 

at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.ja
va:81) 

at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202) 

at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173) 

at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:213) 

at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:178) 

at
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalVal
ve.java:39) 

at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssoci
ationValve.java:159) 

at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:
59) 

at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126
) 

at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105
) 

at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:107) 

at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) 

at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) 

at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:744) 

at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
a:527) 

at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThre
ad.java:112) 

at java.lang.Thread.run(Thread.java:534) 

Caused by: java.io.NotSerializableException:
com.nsite.wsbuilder.TableFiltersBean 

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054) 

at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1224) 

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1050) 

at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1224) 

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1050) 

at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278) 

at java.util.ArrayList.writeObject(ArrayList.java:531) 

at sun.reflect.GeneratedMethodAccessor432.invoke(Unknown Source) 

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25) 

at java.lang.reflect.Method.invoke(Method.java:324) 

at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809) 

at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296) 

at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)


at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052) 

at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1224) 

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1050) 

at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278) 

at org.apache.myfaces.util.StateUtils.encode64(StateUtils.java:33) 

... 47 more

 

Thanks,

Yura.

 

-----Original Message-----
From: Mike Kienenberger [mailto:mkienenb@gmail.com] 
Sent: Thursday, March 30, 2006 6:04 PM
To: MyFaces Discussion
Subject: Re: NotSerializableException during saveState

 

Post your stack trace, but it's probably a non-serializable reference

in your bean that's generating the error, and not your bean.   You

will either need to mark that reference as transient (in which case it

will not be saved or restored) or make that reference serializable (or

StateHolder'able).

 

On 3/30/06, Yura.Tkachenko@muranosoft.com <Yu...@muranosoft.com>
wrote:

> 

> 

> 

> Hi, All

> 

> I'm using MyFaces component saveState and trys to save whole bean, so I

> implemented interface StateHolder for this bean as by manual, but I still

> get NotserializableException for my request scope bean.

> 

> Could you please clarify this moment for me, please? I'm using

> SAVE_STATE_METHOD = client

> 

> 

> 

> As manual I can implements one of these interfaces StateHolder or

> Serializable, but with StateHolder it isn't works, why?

> 

> 

> 

> Thanks,

> 

> Yura.


Re: NotSerializableException during saveState

Posted by Mike Kienenberger <mk...@gmail.com>.
Post your stack trace, but it's probably a non-serializable reference
in your bean that's generating the error, and not your bean.   You
will either need to mark that reference as transient (in which case it
will not be saved or restored) or make that reference serializable (or
StateHolder'able).

On 3/30/06, Yura.Tkachenko@muranosoft.com <Yu...@muranosoft.com> wrote:
>
>
>
> Hi, All
>
> I'm using MyFaces component saveState and trys to save whole bean, so I
> implemented interface StateHolder for this bean as by manual, but I still
> get NotserializableException for my request scope bean.
>
> Could you please clarify this moment for me, please? I'm using
> SAVE_STATE_METHOD = client
>
>
>
> As manual I can implements one of these interfaces StateHolder or
> Serializable, but with StateHolder it isn't works, why?
>
>
>
> Thanks,
>
> Yura.