RestoreView Problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
hfe
Reply | Threaded
Open this post in threaded view
|

RestoreView Problem

hfe
Hi,

I have a legacy system, which has no container tests. I want to add some container tests to test the jsf client. The web.xml contains this session config:

<session-config>
    <cookie-config>
        <http-only>true</http-only>
        <secure>true</secure>
    </cookie-config>
    <tracking-mode>COOKIE</tracking-mode>
</session-config>


When starting EmbeddedTomEEContainer and request a webpage, then this exception will be thrown:

javax.faces.application.ViewExpiredException: /hfe-test-field.xhtml - No saved view state could be found for the view identifier: /hfe-test-field.xhtml
        at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:183)
        at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:196)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:143)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
....

If I delete the tracking mode COOKIE or delete the secure flag the exception won't be thrown.


This call in RestoreViewExecutor can't find the viewRoot, viewRoot is null.

viewRoot = viewHandler.restoreView(facesContext, viewId);


I'm using tomee-embedded:7.0.3 and the myFaces version which comes with this tomee-embedded.

hfe
Reply | Threaded
Open this post in threaded view
|

Re: RestoreView Problem

hfe

Ok, after a lot of research I can say this has nothing to do with TomEE. It looks like a problem of Selenium  HtmlUnitDriver. The cookie with the session id is not at the client site.
Reply | Threaded
Open this post in threaded view
|

Re: RestoreView Problem

Romain Manni-Bucau
In reply to this post by hfe
Hi

did you configure org.apache.myfaces.SERIALIZE_STATE_IN_SESSION?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-05-11 13:01 GMT+02:00 hfe <[hidden email]>:

> Hi,
>
> I have a legacy system, which has no container tests. I want to add some
> container tests to test the jsf client. The web.xml contains this session
> config:
>
> <session-config>
>     <cookie-config>
>         <http-only>true</http-only>
>         <secure>true</secure>
>     </cookie-config>
>     <tracking-mode>COOKIE</tracking-mode>
> </session-config>
>
>
> When starting EmbeddedTomEEContainer and request a webpage, then this
> exception will be thrown:
>
> javax.faces.application.ViewExpiredException: /hfe-test-field.xhtml - No
> saved view state could be found for the view identifier:
> /hfe-test-field.xhtml
>         at
> org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(
> RestoreViewExecutor.java:183)
>         at
> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(
> LifecycleImpl.java:196)
>         at
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:143)
>         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:230)
> ....
>
> If I delete the tracking mode COOKIE or delete the secure flag the
> exception
> won't be thrown.
>
>
> This call in RestoreViewExecutor can't find the viewRoot, viewRoot is null.
>
> viewRoot = viewHandler.restoreView(facesContext, viewId);
>
>
> I'm using tomee-embedded:7.0.3 and the myFaces version which comes with
> this
> tomee-embedded.
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/RestoreView-Problem-tp4681700.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: RestoreView Problem

Romain Manni-Bucau
In reply to this post by hfe
Oh htmlunit, maybe it does worth investing in using phantomjs


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-05-11 14:29 GMT+02:00 hfe <[hidden email]>:

>
> Ok, after a lot of research I can say this has nothing to do with TomEE. It
> looks like a problem of Selenium  HtmlUnitDriver. The cookie with the
> session id is not at the client site.
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/RestoreView-Problem-tp4681700p4681701.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>