You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by rbaumhof <ra...@web.de> on 2009/02/20 21:35:46 UTC

javax.faces.application.ViewExpiredException

Hello,

i have got the problem, that on my login page the session timeout forces the
exception "javax.faces.application.ViewExpiredException":

HTTP Status 500 - 

type Exception report

message 

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception 
javax.faces.application.ViewExpiredException: /allg/login.jsfThe expected
view was not returned for the view identifier: /allg/login.jsf

org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:88)

org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
	org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:148)

org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)

The reason for this seems to be clear. But how could the problem be solved. 

I tried in web.xml:
	<context-param>
    	<param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
    	<param-value>false</param-value>
  	</context-param>
  	
	<error-page>
    
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
    	<location>/allg/expired.jsf</location>
  	</error-page>
	<error-page>
    	<exception-type>java.lang.Exception</exception-type>
    	<location>/allg/fehler.jsf</location>
  	</error-page>
	<error-page>
    	<error-code>500</error-code>
    	<location>/allg/fehler.jsf</location>
  	</error-page>
	<error-page>
    	<error-code>404</error-code>
    	<location>/allg/nichtGefunden.jsf</location>
  	</error-page>
	<error-page>
    	<error-code>500</error-code>
    	<location>/allg/allgFehler.jsf</location>
  	</error-page>
	<error-page>
    	<error-code>505</error-code>
    	<location>/allg/allgFehler.jsf</location>
  	</error-page>

Faces error handling is disabled. So i get a status 500 error. But this is
not redirected to error page. If i try an invalid url which will lead to a
status 404, this is correctly processed. I tried some workarounds to
invalidate the session on login page, but this also did not work.

much thanks, Ralf
-- 
View this message in context: http://www.nabble.com/javax.faces.application.ViewExpiredException-tp22127510s134p22127510.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: javax.faces.application.ViewExpiredException

Posted by rbaumhof <ra...@web.de>.
so, i have implemented the following workaround. The problem results from my
login page beeing a jsf page, rather then a plain html page. So, destroying
the session on entering the page could not work, because faces re-creates
the session while evaluating the html body - which contains references to a
faces backing bean. 

Solution:
When entering the page the actual timeout is saved (in session) and then
session timeout is extended to 20 hours. After a succesful login the timeout
is restored to the old value. This works fine, only persons who leave their
computers powered on over weekend will have a problem on monday morning. But
however, this is tolerable...

The only less satisfying point is, that http status 500 is not redirected to
a specialised error page as configured in web.xml. This only works for
status 404, but not for status 500. This may be an error somewhere in the
depth of the app server. 

much thanks for listening....=)

-- 
View this message in context: http://www.nabble.com/javax.faces.application.ViewExpiredException-tp22127510s134p22180855.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.