You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Vivek Pandey <vi...@sca-tech.com> on 2006/09/25 14:25:24 UTC

Silent Fail in Restore View

Hi

I was earlier using MyFaces 1.1.1 and am trying to move to 1.1.3 right now.
I am getting numerous serialization issues which I am fixing one by one.
However I am stuck at a point from where I am not able to go forward. My
page renders the first time but whenever I request it again (by clicking on
the sort button for example in the datatable) my viewroot becomes NULL. In
the logs, I see this...
DEBUG - jsp.JspStateManagerImpl - Processing deserializeView - deserializing
serialized state. Bytes : 21335
DEBUG - jsp.JspStateManagerImpl - Tree structure restored from server
session
DEBUG - jsp.JspStateManagerImpl - Exiting restoreTreeStructure
DEBUG - jsp.JspStateManagerImpl - Entering restoreComponentState
ERROR - lifecycle.PhaseListenerManager - Exception in PhaseListener
RESTORE_VIEW(1) afterPhase
java.lang.NullPointerException
	at
org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhase(Lj
avax.faces.event.PhaseEvent;)V(AutoScrollPhaseListener.java:52)
	at
org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(
Ljavax.faces.event.PhaseId;)V(PhaseListenerManager.java:89)
	at
org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(Ljavax.faces.context.
FacesContext;Lorg.apache.myfaces.lifecycle.PhaseListenerManager;)Z(Lifecycle
Impl.java:181)
	at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(Ljavax.faces.context.Face
sContext;)V(LifecycleImpl.java:66)

Oddly enough there is no "Exiting restoreComponentState" log message which
leads me to assume the method restoreComponentState failed somewhere in
between. But I cannot make out the reason why.

It maybe that deserialization is not happening properly (and that too most
probably for the datatable component in my page). My guess is it is because
I am using an aliased bean for my datatable and the value field for the
datatable is set to a ListDataModel field variable in the actual bean that I
am setting to the aliasbean. But how do I begin to find out the problem ?
The log messages as well as going through code in JspStateManagerImpl is not
of much help.

Pleas help.





RE: Silent Fail in Restore View

Posted by Vivek Pandey <vi...@sca-tech.com>.
I think I haven't quite got it right as to how to manage data in JSF. Can
you please give some sort of a basic infrastructural recommendation.

What I have right now is
1. A datatable with _value_ set to a property of type _DataModel_ in a
backing bean.
2. the backing bean is of session scope.
3. I have a "reload" method in my backing bean which does
dataModel.setWrappedData(<List>) after getting the <List> from the Data
layer (DAOs). I call it everytime I feel data needs to be refreshed (as in
after an _add_ or an _update_, or even before a _sort_)

My backing bean therefore holds all the data as well as actions for
manipulating that data and is in session scope. Is this the correct approach
? If not, what is ?

P.S. The problem earlier was because of a savestate tag which I now have
removed. But still I am running into problem here and there... that's why I
think my problem is bigger and and at a much higher level.

Vivek Pandey | SCA Technologies LLC, Gurgaon | 91-9818872105 
 
-----Original Message-----
From: Gerald Müllan [mailto:bierbrauen@gmail.com] 
Sent: Monday, September 25, 2006 6:13 PM
To: MyFaces Development
Subject: Re: Silent Fail in Restore View

Hi,

do you use preserveDataModel="true" in your dataTables? If not, the
problem might origin from this case.

In which scope do you have defined this bean?

I prefer setting it to request scope wherever possible, and if needed
extending the life of the bean via serializing it with t:saveState
(value is the name of the bean).

cheers,

Gerald

On 9/25/06, Vivek Pandey <vi...@sca-tech.com> wrote:
> Hi
>
> I was earlier using MyFaces 1.1.1 and am trying to move to 1.1.3 right
now.
> I am getting numerous serialization issues which I am fixing one by one.
> However I am stuck at a point from where I am not able to go forward. My
> page renders the first time but whenever I request it again (by clicking
on
> the sort button for example in the datatable) my viewroot becomes NULL. In
> the logs, I see this...
> DEBUG - jsp.JspStateManagerImpl - Processing deserializeView -
deserializing
> serialized state. Bytes : 21335
> DEBUG - jsp.JspStateManagerImpl - Tree structure restored from server
> session
> DEBUG - jsp.JspStateManagerImpl - Exiting restoreTreeStructure
> DEBUG - jsp.JspStateManagerImpl - Entering restoreComponentState
> ERROR - lifecycle.PhaseListenerManager - Exception in PhaseListener
> RESTORE_VIEW(1) afterPhase
> java.lang.NullPointerException
>         at
>
org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhase(Lj
> avax.faces.event.PhaseEvent;)V(AutoScrollPhaseListener.java:52)
>         at
>
org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(
> Ljavax.faces.event.PhaseId;)V(PhaseListenerManager.java:89)
>         at
>
org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(Ljavax.faces.context.
>
FacesContext;Lorg.apache.myfaces.lifecycle.PhaseListenerManager;)Z(Lifecycle
> Impl.java:181)
>         at
>
org.apache.myfaces.lifecycle.LifecycleImpl.execute(Ljavax.faces.context.Face
> sContext;)V(LifecycleImpl.java:66)
>
> Oddly enough there is no "Exiting restoreComponentState" log message which
> leads me to assume the method restoreComponentState failed somewhere in
> between. But I cannot make out the reason why.
>
> It maybe that deserialization is not happening properly (and that too most
> probably for the datatable component in my page). My guess is it is
because
> I am using an aliased bean for my datatable and the value field for the
> datatable is set to a ListDataModel field variable in the actual bean that
I
> am setting to the aliasbean. But how do I begin to find out the problem ?
> The log messages as well as going through code in JspStateManagerImpl is
not
> of much help.
>
> Pleas help.
>
>
>
>
>


-- 
http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces




Re: Silent Fail in Restore View

Posted by Gerald Müllan <bi...@gmail.com>.
Hi,

do you use preserveDataModel="true" in your dataTables? If not, the
problem might origin from this case.

In which scope do you have defined this bean?

I prefer setting it to request scope wherever possible, and if needed
extending the life of the bean via serializing it with t:saveState
(value is the name of the bean).

cheers,

Gerald

On 9/25/06, Vivek Pandey <vi...@sca-tech.com> wrote:
> Hi
>
> I was earlier using MyFaces 1.1.1 and am trying to move to 1.1.3 right now.
> I am getting numerous serialization issues which I am fixing one by one.
> However I am stuck at a point from where I am not able to go forward. My
> page renders the first time but whenever I request it again (by clicking on
> the sort button for example in the datatable) my viewroot becomes NULL. In
> the logs, I see this...
> DEBUG - jsp.JspStateManagerImpl - Processing deserializeView - deserializing
> serialized state. Bytes : 21335
> DEBUG - jsp.JspStateManagerImpl - Tree structure restored from server
> session
> DEBUG - jsp.JspStateManagerImpl - Exiting restoreTreeStructure
> DEBUG - jsp.JspStateManagerImpl - Entering restoreComponentState
> ERROR - lifecycle.PhaseListenerManager - Exception in PhaseListener
> RESTORE_VIEW(1) afterPhase
> java.lang.NullPointerException
>         at
> org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhase(Lj
> avax.faces.event.PhaseEvent;)V(AutoScrollPhaseListener.java:52)
>         at
> org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(
> Ljavax.faces.event.PhaseId;)V(PhaseListenerManager.java:89)
>         at
> org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(Ljavax.faces.context.
> FacesContext;Lorg.apache.myfaces.lifecycle.PhaseListenerManager;)Z(Lifecycle
> Impl.java:181)
>         at
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(Ljavax.faces.context.Face
> sContext;)V(LifecycleImpl.java:66)
>
> Oddly enough there is no "Exiting restoreComponentState" log message which
> leads me to assume the method restoreComponentState failed somewhere in
> between. But I cannot make out the reason why.
>
> It maybe that deserialization is not happening properly (and that too most
> probably for the datatable component in my page). My guess is it is because
> I am using an aliased bean for my datatable and the value field for the
> datatable is set to a ListDataModel field variable in the actual bean that I
> am setting to the aliasbean. But how do I begin to find out the problem ?
> The log messages as well as going through code in JspStateManagerImpl is not
> of much help.
>
> Pleas help.
>
>
>
>
>


-- 
http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces