0

I have Googled for a while but I can't get rid of a javax.faces.application.ViewExpiredException every time I reboot my Liberty Prifle 8.5.5.8 server for users that are using the server. This exception is only thrown in xhtml (JSF2) pages annotated with new JSF2.2 javax.faces.view.ViewScoped I don't won't to enable client side session as that makes system much slower, so I prefer to disable the session information so when I reboot Liberty users have to login again.

How can I disable it? (I have not enabled database session persistence, but I still have session persisted across server reboots).

I have other problems related to sessions so even if there is another workaround to stop those ViewExpiredException, I would like to disable session persistence.

Thanks for any help, Ignacio

(P.D.: My same question asked in IBM DW answers: https://developer.ibm.com/answers/questions/249829/how-to-disable-session-persistence-across-liberty.html#comment-250065 )

icordoba
  • 1,834
  • 2
  • 33
  • 60

1 Answers1

0

Session persistence is not enabled by default on WebSphere Liberty. This is probably not the cause of your issue.

The problem is that the page has a hidden input field javax.faces.ViewState that is used to reference the view state on the server (when javax.faces.STATE_SAVING_METHOD is set to server). When a postback is made to that page, JSF will try to use that view state ID to find the view. This is a problem if the server was restarted as the view no longer exists.

For more information, BalusC has a nice post on this issue already: javax.faces.application.ViewExpiredException: View could not be restored

Community
  • 1
  • 1
hwibell
  • 134
  • 3