You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by hfe <a...@h41.de> on 2017/05/11 11:01:02 UTC

RestoreView Problem

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.

Re: RestoreView Problem

Posted by Romain Manni-Bucau <rm...@gmail.com>.
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 <a...@h41.de>:

>
> 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.
>

Re: RestoreView Problem

Posted by hfe <a...@h41.de>.
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.

Re: RestoreView Problem

Posted by Romain Manni-Bucau <rm...@gmail.com>.
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 <a...@h41.de>:

> 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.
>