myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Werner Punz <werner.p...@gmail.com>
Subject Re: How to troubleshoot ViewExpiredException ?
Date Thu, 29 Dec 2011 16:22:55 GMT
The root cause of this issue is a JSF spec problem which will be 
addressed as it seems with jsf 2.2.

The other workaround is to add all forms of the page as render targets
this is the official jsf 2.1 workaround.

The problem is you cannot enable a update all forms per page method per 
default because the javascript does not have any viewroot information
and updating all forms automatically would break the portlet environments.

Werner


Am 29.12.11 15:20, schrieb Michael Heinen:
> See https://issues.apache.org/jira/browse/MYFACES-2881
>
> It seems to be still required because it updates the viewstates of all
> forms on the page.
> Otherwise only the viewstate of the submitted form (or rerendered forms)
> is updated.
> It's a workaround.
>
> Michael
>
> Am 29.12.2011 14:51, schrieb Rohit Kelapure:
>> Why do I need this Javascript ?
>>
>> --Thanks,
>> Rohit
>>
>> On Thu, Dec 29, 2011 at 5:39 AM, Milo van der
>> Zee<milo@vanderzee.org>wrote:
>>
>>> He probably has multiple forms and could try to add the famous piece of
>>> javascript. Even though I used RF2.1.0 and MyFaces 2.1.5 I still do need
>>> it as well.
>>>
>>> <script type="text/javascript">
>>> // fixup for an issue of the jsf2.0 and 2.1 ajax
>>> // spec to deal with multiple forms per page.
>>> // => ViewExpiredException occurs if you heavy use ajax within
>>> // more than one form (MYFACES-3159)
>>> window.myfaces = window.myfaces || {};
>>> myfaces.config = myfaces.config || {};
>>> myfaces.config.no_portlet_env = true;
>>> </script>
>>>
>>> MAG,
>>> Milo
>>>
>>>
>>> On Wed, 2011-12-28 at 22:55 +0100, Werner Punz wrote:
>>>> Do you use multiple forms in conjunction with JSF ajax?
>>>>
>>>> Werner
>>>>
>>>>
>>>> Am 28.12.11 18:30, schrieb Rohit Kelapure:
>>>>> Dear all,
>>>>>
>>>>> We have run into an issue with our application in production wherein
>>> once a
>>>>> database rollback occurs, our application state somehow gets messed
>>> and we
>>>>> repeatedly keep seeing ViewExpiredExceptions like so ...
>>>>>
>>>>> [12/24/11 3:51:52:301 EST] 000003b3 SystemErr R
>>>>> javax.faces.application.ViewExpiredException: /showItem.xhtml No saved
>>> view
>>>>> state could be found for the view identifier: /showItem.xhtmlnull
>>>>> [12/24/11 3:51:52:302 EST] 000003b3 SystemErr R at
>>>>>
>>> org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:128)null
>>>
>>>>> [12/24/11 3:51:52:302 EST] 000003b3 SystemErr R at
>>>>>
>>> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)null
>>>
>>>>> [12/24/11 3:51:52:302 EST] 000003b3 SystemErr R at
>>>>>
>>> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)null
>>>
>>>>> Caused by: javax.faces.application.ViewExpiredException:
>>>>> /showShoppingCart.xhtml No saved view state could be found for the
>>>>> view
>>>>> identifier: /showShoppingCart.xhtml
>>>>> at
>>>>>
>>> org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:128)
>>>
>>>>> at
>>>>>
>>> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
>>>
>>>>> at
>>>>>
>>> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
>>>
>>>>> at
>>> com.ibm.faces20.portlet.FacesPortlet.processAction(FacesPortlet.java:238)
>>>
>>>>> This happens for ALL the JSF facelets *.xhtml files in our
>>> application.
>>>>> This is a JSF 2 application.
>>>>>
>>>>> What is the next step in debugging these ViewExpiredExceptions ?
>>>>> For starters I have enabled the trace *
>>>>> *=info:org.apache.myfaces.lifecycle*=all*
>>>>> *
>>>>> *
>>>>> All your tips are appreciated.
>>>>>
>>>>> --Thanks,
>>>>> Rohit Kelapure
>>>>>
>>>>
>>>>
>>>
>>>
>
>



Mime
View raw message