jsf-2.2viewexpiredexceptionwebsphere-9

Facing myFaces error when migrating from WAS8 to WAS9?


We are currently migrating our application from WAS8 to WAS9. We use JSF 2.2 and Primefaces 4.0. In WAS8 application works fine.But in WAS9 we are getting the following error:

Uncaught service() exception root cause Faces Servlet: javax.servlet.ServletException: /pages/xyz.xhtml - No saved view state could be found for the view identifier: /pages/xyz.xhtml

Our web.xml looks like following :

<context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Production</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
        <param-value>true</param-value>
    </context-param>
    
    <context-param>
        <param-name>org.apache.myfaces.COMPRESS_STATE_IN_CLIENT</param-name>
        <param-value>true</param-value>
    </context-param>
    
   <context-param>
        <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
        <param-value>true</param-value>
    </context-param>

Tried changing STATE_SAVING_METHOD to client.But that is not working. Can anyone kindly help me in resolving this error. Thanks in advance.


Solution

  • I'd prefer to comment, but I do not have enough points.

    It's hard to say what could be the causing this without more information.

    Web.xml seems fine. Otherwise factors that can cause this error is session expiration or an problem with the cookies.

    Another possibility is that javax.faces.ViewState may be corrupted?

    My idea is that org_apache_myfaces_NUMBER_OF_VIEWS_IN_SESSION may need to be increased?

    http://myfaces.apache.org/core20/myfaces-impl/webconfig.html#org_apache_myfaces_NUMBER_OF_VIEWS_IN_SESSION

    But please read more about the viewexpiredexception below and I hope that may help you identity the problem. javax.faces.application.ViewExpiredException: View could not be restored