I have a JSF (Mojarra 2.2.20) that is deployed on Tomcat 8.5 on a clustered environement.
My catalina.out
is filled with this error:
ERROR: MAC did not verify!
I've been reading posts like: Getting ViewExpiredException in clustered environment while state saving method is set to client and user session is valid and following the steps indicated.
EDIT: Taking into account BalusC comment I modified my configuration, and now it looks like this. However I keep getting the error in the production environment.
This is my configuration:
public void onStartup(ServletContext servletContext) throws ServletException {
servletContext.setInitParameter("javax.faces.STATE_SAVING_METHOD", "client");
servletContext.setInitParameter("javax.faces.DEFAULT_SUFFIX", ".xhtml");
servletContext.setInitParameter("javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE", "true");
servletContext.setInitParameter("org.omnifaces.FACES_VIEWS_SCAN_PATHS", "/*.xhtml");
servletContext.setInitParameter("primefaces.CLIENT_SIDE_VALIDATION", "true");
servletContext.setInitParameter("primefaces.THEME", "flick");
servletContext.setInitParameter("primefaces.UPLOADER", "native");
}
And this is my web.xml
:
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<display-name>app-name</display-name>
<distributable />
<env-entry>
<env-entry-name>jsf/ClientSideSecretKey</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>[KEY generated with the code in the post linked]</env-entry-value>
</env-entry>
<error-page>
<error-code>500</error-code>
<location>/pages/error/error.xhtml</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/pages/error/notFound.xhtml</location>
</error-page>
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/pages/error/timeout.xhtml</location>
</error-page>
<session-config>
<session-timeout>15</session-timeout>
</session-config>
</web-app>
According to other posts published in stackoverflow my setup is correct, what am I missing?
Thanks.