You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Hamed Iravanchi <ir...@gmail.com> on 2011/06/25 15:12:24 UTC

ViewExpiredException in MyFaces 2.0.6

Hi,

I'm getting ViewExpiredSession by clicking on any button in my pages after
upgrading MyFaces 2.0.5 to 2.0.6.
My pages have multiple forms, any button in any of them raises the same
error.

I'm using facelets version 1.1.6.

I see some changes in the state caching on the change list of 2.0.6, and I'm
not sure is it something that I'm doing wrong (and it worked by chance in
2.0.5) or there's some bug in 2.0.6.
(I tried 2.0.7, and it has the same problem.)

-Hamed

Re: ViewExpiredException in MyFaces 2.0.6

Posted by Werner Punz <we...@gmail.com>.
Am 27.06.11 08:50, schrieb Hamed Iravanchi:
> Hi,
>
> Thanks, Leonardo, for your time.
> I tested it with the old state manager, as instructed by you, and the
> problem was still there.
> So, you're probably right and it's something related to my special setup.
>
> Do you have any hints for me to find out what's causing this?
> Is there any log categories to turn on to see what's happening?
>
Just a sidequestion are you using ajax? The JSF spec is broken and can 
cause this error in the ajax/multiform scenarion. I added workarounds 
for this case.
Just in case this happens if you use ajax add following code to your 
markup which fixes the issue:

     <script type="text/javascript">
         //fixup for an issue of the jsf2.0 and 2.1 ajax spec to deal 
with multiple forms per page
         window.myfaces = window.myfaces || {};
         myfaces.config = myfaces.config || {};
         myfaces.config.no_portlet_env = true;
     </script>

This resolves the jsf spec issue for non portlet scenarios regarding ajax.
	


Re: ViewExpiredException in MyFaces 2.0.6

Posted by Hamed Iravanchi <ir...@gmail.com>.
Hi,

Thanks, Leonardo, for your time.
I tested it with the old state manager, as instructed by you, and the
problem was still there.
So, you're probably right and it's something related to my special setup.

Do you have any hints for me to find out what's causing this?
Is there any log categories to turn on to see what's happening?

-Hamed


On Mon, Jun 27, 2011 at 7:04 AM, Leonardo Uribe <lu...@gmail.com> wrote:

> Hi
>
> I checked the algorithms related on MyFaces and everything seems to be
> ok. I fixed https://issues.apache.org/jira/browse/MYFACES-3105 too,
> but that one is not your case. In fact, there are some special junit
> cases that ensures state saving algorithm is symmetric, and other
> tests ensures ajax and normal request are saved/restored correctly.
>
> Maybe your problem is not related with JSF, and it has to be with
> something about your servlet configuration or special setup. Note that
> JSF relies on servlet session mechanism to state saving.
>
> regards,
>
> Leonardo Uribe
>
> 2011/6/25 Leonardo Uribe <lu...@gmail.com>:
> > Hi
> >
> > There was some changes on state saving algorithm. All tests done passed,
> but
> > the previous algorithm was preserved too. It was found a bug on 2.0.6, so
> > the following is valid 2.0.7 / 2.1.1 . Add in your web.xml file the
> > following:
> >
> >   <context-param>
> >
> >
> <param-name>org.apache.myfaces.HANDLE_STATE_CACHING_MECHANICS</param-name>
> >     <param-value>false</param-value>
> >   </context-param>
> >
> > and then on faces-config.xml
> >
> >
> <state-manager>org.apache.myfaces.application.jsp.JspStateManagerImpl</state-manager>
> >
> > This goes inside <application> section. In this way the previous
> algorithm
> > is used instead. If that works let us know, to try to reproduce it and
> fix
> > it on future MyFaces versions.
> >
> > regards,
> >
> > Leonardo
> >
> > 2011/6/25 Hamed Iravanchi <ir...@gmail.com>
> >>
> >> Hi,
> >>
> >> I'm getting ViewExpiredSession by clicking on any button in my pages
> after
> >> upgrading MyFaces 2.0.5 to 2.0.6.
> >> My pages have multiple forms, any button in any of them raises the same
> >> error.
> >>
> >> I'm using facelets version 1.1.6.
> >>
> >> I see some changes in the state caching on the change list of 2.0.6, and
> >> I'm
> >> not sure is it something that I'm doing wrong (and it worked by chance
> in
> >> 2.0.5) or there's some bug in 2.0.6.
> >> (I tried 2.0.7, and it has the same problem.)
> >>
> >> -Hamed
> >
> >
>

Re: ViewExpiredException in MyFaces 2.0.6

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

I checked the algorithms related on MyFaces and everything seems to be
ok. I fixed https://issues.apache.org/jira/browse/MYFACES-3105 too,
but that one is not your case. In fact, there are some special junit
cases that ensures state saving algorithm is symmetric, and other
tests ensures ajax and normal request are saved/restored correctly.

Maybe your problem is not related with JSF, and it has to be with
something about your servlet configuration or special setup. Note that
JSF relies on servlet session mechanism to state saving.

regards,

Leonardo Uribe

2011/6/25 Leonardo Uribe <lu...@gmail.com>:
> Hi
>
> There was some changes on state saving algorithm. All tests done passed, but
> the previous algorithm was preserved too. It was found a bug on 2.0.6, so
> the following is valid 2.0.7 / 2.1.1 . Add in your web.xml file the
> following:
>
>   <context-param>
>
> <param-name>org.apache.myfaces.HANDLE_STATE_CACHING_MECHANICS</param-name>
>     <param-value>false</param-value>
>   </context-param>
>
> and then on faces-config.xml
>
> <state-manager>org.apache.myfaces.application.jsp.JspStateManagerImpl</state-manager>
>
> This goes inside <application> section. In this way the previous algorithm
> is used instead. If that works let us know, to try to reproduce it and fix
> it on future MyFaces versions.
>
> regards,
>
> Leonardo
>
> 2011/6/25 Hamed Iravanchi <ir...@gmail.com>
>>
>> Hi,
>>
>> I'm getting ViewExpiredSession by clicking on any button in my pages after
>> upgrading MyFaces 2.0.5 to 2.0.6.
>> My pages have multiple forms, any button in any of them raises the same
>> error.
>>
>> I'm using facelets version 1.1.6.
>>
>> I see some changes in the state caching on the change list of 2.0.6, and
>> I'm
>> not sure is it something that I'm doing wrong (and it worked by chance in
>> 2.0.5) or there's some bug in 2.0.6.
>> (I tried 2.0.7, and it has the same problem.)
>>
>> -Hamed
>
>

Re: ViewExpiredException in MyFaces 2.0.6

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

There was some changes on state saving algorithm. All tests done passed, but
the previous algorithm was preserved too. It was found a bug on 2.0.6, so
the following is valid 2.0.7 / 2.1.1 . Add in your web.xml file the
following:

  <context-param>

<param-name>org.apache.myfaces.HANDLE_STATE_CACHING_MECHANICS</param-name>
    <param-value>false</param-value>
  </context-param>

and then on faces-config.xml

<state-manager>org.apache.myfaces.application.jsp.JspStateManagerImpl</state-manager>

This goes inside <application> section. In this way the previous algorithm
is used instead. If that works let us know, to try to reproduce it and fix
it on future MyFaces versions.

regards,

Leonardo

2011/6/25 Hamed Iravanchi <ir...@gmail.com>

> Hi,
>
> I'm getting ViewExpiredSession by clicking on any button in my pages after
> upgrading MyFaces 2.0.5 to 2.0.6.
> My pages have multiple forms, any button in any of them raises the same
> error.
>
> I'm using facelets version 1.1.6.
>
> I see some changes in the state caching on the change list of 2.0.6, and
> I'm
> not sure is it something that I'm doing wrong (and it worked by chance in
> 2.0.5) or there's some bug in 2.0.6.
> (I tried 2.0.7, and it has the same problem.)
>
> -Hamed
>

Re: ViewExpiredException in MyFaces 2.0.6

Posted by Martin Koci <ma...@gmail.com>.
Hi,

Hamed Iravanchi píše v So 25. 06. 2011 v 17:42 +0430:
> Hi,
> 
> I'm getting ViewExpiredSession by clicking on any button in my pages after
> upgrading MyFaces 2.0.5 to 2.0.6.
> My pages have multiple forms, any button in any of them raises the same
> error.
> 
This is probably related to:
https://issues.apache.org/jira/browse/MYFACES-3117



> I'm using facelets version 1.1.6.

please remove old facelets from your classpath. With JSF 2.0 (myfaces
2.0.X) facelets are included in jsf runtime and presence of old facelets
1.1.X on classpath can  cause problems.

Regards,

Kočičák
> 
> I see some changes in the state caching on the change list of 2.0.6, and I'm
> not sure is it something that I'm doing wrong (and it worked by chance in
> 2.0.5) or there's some bug in 2.0.6.
> (I tried 2.0.7, and it has the same problem.)
> 
> -Hamed