Re: ViewExpiredException: No saved view state could be found for the view identifier

2015-11-23 Thread Jojada Tirtowidjojo
Thanks, Kito, for your response. Below is my finding.

The cookie setting in the web.xml is:

   240
   
  true
  true

COOKIE
   

When I first visit the login page, the Http Response Headers from the
server is

   1. HTTP/1.1 200 OK Date: Tue, 24 Nov 2015 02:24:22 GMT Set-Cookie:
   JSESSIONID=11cp2c2bxz66fgyqfso1mrcgw;Path=/TeraTextRS;Secure;HttpOnly
   Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type:
   text/html;charset=utf-8 Transfer-Encoding: chunked Server:
   Jetty(9.3.6.v20151106)

I can see the 'Set-Cookie' header is set by the server.
However, when I submit the login form, the Http Request Headers from the
client is:

   1. POST /TeraTextRS/pages/login.rs HTTP/1.1 Host: localhost:7620
   Connection: keep-alive Content-Length: 157 Cache-Control: max-age=0 Accept:
   text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
   Origin: http://localhost:7620 Upgrade-Insecure-Requests: 1 User-Agent:
   Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like
   Gecko) Chrome/46.0.2490.86 Safari/537.36 Content-Type:
   application/x-www-form-urlencoded DNT: 1 Referer:
http://localhost:7620/TeraTextRS/pages/login.rs
   Accept-Encoding
   : gzip,
   deflate Accept-Language: en-US,en;q=0.8

There isn't 'Cookie' header in the request.
The client is Chrome and I have already set its Cookies setting to 'Allow
local data to be set'.

The fact that the request header does not have 'Cookie' header set has
bothered me.
Any idea on what could have gone wrong ?

Jo.-


On Sat, Nov 21, 2015 at 12:32 AM, Kito Mann  wrote:

> It sounds like Jetty's cookie session setting isn't working correctly. Try
> looking at the request and response headers to see if it's being set. If
> not, you'll need to figure out why Jetty isn't setting it correctly.
>
> On Thursday, November 19, 2015, Jojada Tirtowidjojo 
> wrote:
>
> > Hi All,
> >
> > I am new to JSF and Myfaces and need answers or pointers that can help me
> > fix the problem I am currently having. Would you please help ?
> >
> > My application embeds a Jetty 9.3.6 server and uses the Apache MyFaces
> > 2.2.8. It runs well with the Jetty default session tracking modes: URL
> and
> > COOKIE but a problem arises when I change the tracking mode to 'COOKIE'
> > only. As soon as I submit login details from the login page I receive the
> > following exception:
> >
> > javax.faces.application.ViewExpiredException: /pages/login.rs - No
> > saved view state could be found for the view identifier:
> > /pages/login.rs
> > 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.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
> > at
> >
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1685)
> > at
> >
> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:357)
> > at
> >
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
> > at
> >
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
> > at
> >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> > at
> >
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
> > at
> >
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
> > at
> >
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158)
> > at
> > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
> > at
> >
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
> > at
> >
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090)
> > at
> >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> > at
> >
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
> > at
> >
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
> > at org.eclipse.jetty.server.Server.handle(Server.java:517)
> > at
> > org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
> > at
> >
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
> > at
> >
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
> > at
> 

Re: ViewExpiredException: No saved view state could be found for the view identifier

2015-11-20 Thread Kito Mann
It sounds like Jetty's cookie session setting isn't working correctly. Try
looking at the request and response headers to see if it's being set. If
not, you'll need to figure out why Jetty isn't setting it correctly.

On Thursday, November 19, 2015, Jojada Tirtowidjojo 
wrote:

> Hi All,
>
> I am new to JSF and Myfaces and need answers or pointers that can help me
> fix the problem I am currently having. Would you please help ?
>
> My application embeds a Jetty 9.3.6 server and uses the Apache MyFaces
> 2.2.8. It runs well with the Jetty default session tracking modes: URL and
> COOKIE but a problem arises when I change the tracking mode to 'COOKIE'
> only. As soon as I submit login details from the login page I receive the
> following exception:
>
> javax.faces.application.ViewExpiredException: /pages/login.rs - No
> saved view state could be found for the view identifier:
> /pages/login.rs
> 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.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1685)
> at
> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:357)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158)
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
> at org.eclipse.jetty.server.Server.handle(Server.java:517)
> at
> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
> at
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
> at
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
> at
> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
> at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
> at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
> at java.lang.Thread.run(Thread.java:745)
>
> Tracing the Myfaces code suggests that the previously saved
> SerializedViewCollection object in the servlet session, somehow, has gone
> missing during an attempt to restore the login view.
>
> Any comment, answer, and/or pointer is very much appreciated.
>
> Cheers,
>


-- 
___

Kito D. Mann | @kito99 | Author, JSF in Action
Web Components/Polymer, JSF/Java EE, and Liferay training and consulting
Virtua, Inc. | http://www.virtua.com |
http://www.JSFCentral.com | @jsfcentral
+1 203-998-0403

* Listen to the Enterprise Java Newscast: *http://
enterprisejavanews.com
*


ViewExpiredException: No saved view state could be found for the view identifier

2015-11-19 Thread Jojada Tirtowidjojo
Hi All,

I am new to JSF and Myfaces and need answers or pointers that can help me
fix the problem I am currently having. Would you please help ?

My application embeds a Jetty 9.3.6 server and uses the Apache MyFaces
2.2.8. It runs well with the Jetty default session tracking modes: URL and
COOKIE but a problem arises when I change the tracking mode to 'COOKIE'
only. As soon as I submit login details from the login page I receive the
following exception:

javax.faces.application.ViewExpiredException: /pages/login.rs - No
saved view state could be found for the view identifier:
/pages/login.rs
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.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1685)
at 
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:357)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at 
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158)
at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090)
at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at 
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
at org.eclipse.jetty.server.Server.handle(Server.java:517)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
at 
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
at 
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at 
org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
at 
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
at 
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
at 
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
at java.lang.Thread.run(Thread.java:745)

Tracing the Myfaces code suggests that the previously saved
SerializedViewCollection object in the servlet session, somehow, has gone
missing during an attempt to restore the login view.

Any comment, answer, and/or pointer is very much appreciated.

Cheers,


Re: ViewExpiredException - No saved view state could be found for the view identifier

2010-09-01 Thread Guy Rouillier

On 8/31/2010 4:53 PM, Micah Klitgaard wrote:


javax.faces.application.ViewExpiredException: /pages/login.xhtmlNo saved
view state could be found for the view identifier: /pages/login.xhtml


ViewExpiredException is one of the most common exceptions you'll 
encounter in JSF.  I'd suggest you start by reading some background 
material on the JSF life cycle (just Google those three terms.)


Try setting your session-timeout to 30 and state_saving_method to server.

--
Guy Rouillier


Re: ViewExpiredException - No saved view state could be found for the view identifier

2010-09-01 Thread mk

I have been reading about Lifecylces and this is my fourth JSF project.

As far as I know 30 minutes is default timeout on Tomcat and server state
saving is also default - according to log output.

The code is very simple, so if it isn't a bug it should be easy to fix if
I'm doing something wrong.

Thanks

 On 8/31/2010 4:53 PM, Micah Klitgaard wrote:

 javax.faces.application.ViewExpiredException: /pages/login.xhtmlNo saved
 view state could be found for the view identifier: /pages/login.xhtml

 ViewExpiredException is one of the most common exceptions you'll
 encounter in JSF.  I'd suggest you start by reading some background
 material on the JSF life cycle (just Google those three terms.)

 Try setting your session-timeout to 30 and state_saving_method to server.

 --
 Guy Rouillier





Re: ViewExpiredException - No saved view state could be found for the view identifier

2010-09-01 Thread Matthias Wessendorf
see the other thread on this (ViewExpiredException) topic

-M

On Wed, Sep 1, 2010 at 9:57 AM,  m...@micah-co.com wrote:

 I have been reading about Lifecylces and this is my fourth JSF project.

 As far as I know 30 minutes is default timeout on Tomcat and server state
 saving is also default - according to log output.

 The code is very simple, so if it isn't a bug it should be easy to fix if
 I'm doing something wrong.

 Thanks

 On 8/31/2010 4:53 PM, Micah Klitgaard wrote:

 javax.faces.application.ViewExpiredException: /pages/login.xhtmlNo saved
 view state could be found for the view identifier: /pages/login.xhtml

 ViewExpiredException is one of the most common exceptions you'll
 encounter in JSF.  I'd suggest you start by reading some background
 material on the JSF life cycle (just Google those three terms.)

 Try setting your session-timeout to 30 and state_saving_method to server.

 --
 Guy Rouillier







-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf


Re: ViewExpiredException - No saved view state could be found for the view identifier

2010-09-01 Thread mk
Thanks M.

I have nearly read all posts on those 20 pages with this topic. Nothing
new came to my mind. Further more I explicitly added context params for
session timeout, state saving method and numbers of views in session.

Please take a look at the code.


 see the other thread on this (ViewExpiredException) topic

 -M





ViewExpiredException - No saved view state could be found for the view identifier

2010-08-31 Thread Micah Klitgaard
Hi,

 

I have been searching for a solution for two days now so I hope you are able
to help me out with the basics!

 

jdk1.6.0_21, Tomcat 6.0.29, myfaces-core-2.0.1, trinidad-2.0.0-alpha-2 (same
problem before Trinidad), IntelliJ 9

 

javax.faces.application.ViewExpiredException: /pages/login.xhtmlNo saved
view state could be found for the view identifier: /pages/login.xhtml

   at
org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor
.java:128)

   at
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:1
71)

   at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

   at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)

   at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:290)

   at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)

   at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:233)

   at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)

   at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127
)

   at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102
)

   at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)

   at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

   at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)

   at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
11Protocol.java:588)

   at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

   at java.lang.Thread.run(Thread.java:619)

 

 

::: faces-config.xml :::

 

faces-config xmlns=http://java.sun.com/xml/ns/javaee;

  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

  xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd;

  version=2.0

 

managed-bean

managed-bean-nameloginBean/managed-bean-name

managed-bean-classgpstracer.beans.LoginBean/managed-bean-class

managed-bean-scopesession/managed-bean-scope

/managed-bean

 

navigation-rule

navigation-case

from-outcomelogin/from-outcome

to-view-id/pages/login.xhtml/to-view-id

redirect/

/navigation-case

navigation-case

from-outcomefrontpage/from-outcome

to-view-id/pages/frontpage.xhtml/to-view-id

redirect/

/navigation-case

/navigation-rule

 

/faces-config

 

 

::: web.xml :::

 

?xml version=1.0 encoding=UTF-8?

web-app xmlns=http://java.sun.com/xml/ns/javaee;

   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

   xsi:schemaLocation=http://java.sun.com/xml/ns/javaee

 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;

   version=2.5

 

   !-- Context params --

   welcome-file-list

  welcome-fileindex.xhtml/welcome-file

   /welcome-file-list

 

servlet

servlet-nameFaces Servlet/servlet-name

servlet-classjavax.faces.webapp.FacesServlet/servlet-class

load-on-startup1/load-on-startup

/servlet

servlet-mapping

servlet-nameFaces Servlet/servlet-name

url-pattern/faces/*/url-pattern

/servlet-mapping

servlet-mapping

servlet-nameFaces Servlet/servlet-name

url-pattern*.xhtml/url-pattern

/servlet-mapping

/web-app

 

 

::: login.xhtml :::

 

html xmlns=http://www.w3.org/1999/xhtml;
xmlns:ui=http://java.sun.com/jsf/facelets;

  xmlns:h=http://java.sun.com/jsf/html;

 

body

h:form id=login 

h:inputText value=#{loginBean.username}/

h:inputText value=#{loginBean.password}/

h:commandButton action=#{loginBean.login} value=next/   

/h:form

/body

/html

 

::: LoginBean.java :::

 

public class LoginBean {

 

private String username;

private String password;

 

public String login(){

return frontpage;

}

..

..

 

I load the page by calling index.xhtml or
localhost:8080/faces/pages/login.xhtml.

 

Hope you can help with this one! Thanks a lot.

 

-MICAH