RichFaces Ajax calls failed in cluster on failover
fensminger Mar 19, 2009 12:21 PMHello,
My problem is :
- Tomcat 6 in cluster configured with replicated session for failover.
- A client is on one node and browse normaly.
- The node on which is the client is stopped.
- The AJAX call of the client failed when for example when he tries to sort a rich:datatable tag.
However, if he tries to see a new page, the server responds a good page. So, the session seems to be correctly replicated.
I add a filter to verify that my session is serilisable and it is ok.
I think that RichFaces 3.3.0GA (ajax4jsf) has a problem to save its state.
The implementation of JSF is MyFaces 1.2.6.
Has anybody know this problem ? is it a bug ?
Thanks,
Frederic.
Errors logs :
javax.faces.FacesException: javax.crypto.BadPaddingException: Given final block not properly padded org.apache.myfaces.shared_impl.util.StateUtils.symmetric(StateUtils.java:373) org.apache.myfaces.shared_impl.util.StateUtils.symmetric(StateUtils.java:411) org.apache.myfaces.shared_impl.util.StateUtils.decrypt(StateUtils.java:291) org.apache.myfaces.shared_impl.util.StateUtils.reconstruct(StateUtils.java:240) org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getSavedState(HtmlResponseStateManager.java:187) org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getTreeStructureToRestore(HtmlResponseStateManager.java:151) org.ajax4jsf.application.AjaxStateManager.restoreLogicalViewId(AjaxStateManager.java:573) org.ajax4jsf.application.AjaxStateManager.restoreStateFromSession(AjaxStateManager.java:454) org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:402) org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:515) com.ocpsoft.pretty.application.PrettyViewHandler.restoreView(PrettyViewHandler.java:93) com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316) org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:107) org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:85) 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:151) org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178) org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390) org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517) org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:359)
Web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app id="LUXNEXT_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" > <display-name>LUXNEXT</display-name> <context-param> <param-name>webAppRootKey</param-name> <param-value>luxnext.root</param-value> </context-param> <context-param> <param-name>javax.servlet.jsp.jstl.fmt.fallbackLocale</param-name> <param-value>fr</param-value> </context-param> <context-param> <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> <param-value>lu.bourse.lxn.traduction.TraductionBundle</param-value> </context-param> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>/WEB-INF/log4j.xml</param-value> </context-param> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml /WEB-INF/applicationContext-security.xml</param-value> </context-param> <context-param> <param-name>org.richfaces.SKIN</param-name> <param-value>luxnext</param-value> </context-param> <context-param> <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name> <param-value>com.sun.facelets.FaceletViewHandler</param-value> </context-param> <context-param> <param-name>javax.faces.CONFIG_FILES</param-name> <param-value>/WEB-INF/faces-config-main.xml,/WEB-INF/fr/faces-config-nav.xml,/WEB-INF/en/faces-config-nav.xml</param-value> </context-param> <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.xhtml</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>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>facelets.LIBRARIES</param-name> <param-value>/WEB-INF/taglib/jstl-core.taglib.xml;/WEB-INF/taglib/jstl-fn.taglib.xml;/WEB-INF/taglib/custom.taglib.xml;/WEB-INF/taglib/tomahawk.taglib.xml</param-value> </context-param> <context-param> <param-name>org.apache.myfaces.ERROR_HANDLING</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>facelets.DEVELOPMENT</param-name> <param-value>true</param-value> </context-param> <!-- Optional JSF-RI Parameters to Help Debug --> <context-param> <param-name>com.sun.faces.validateXml</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>com.sun.faces.verifyObjects</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>facelets.REFRESH_PERIOD</param-name> <param-value>2</param-value> </context-param> <!-- Pour que IE6 ne bugge pas, il faut un Buffer size > 0 --> <context-param> <param-name>facelets.BUFFER_SIZE</param-name> <param-value>131072</param-value> </context-param> <!-- Leave the listener commented-out if using JBoss --> <listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> <listener> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> </listener> <listener> <listener-class>lu.bourse.lxn.commun.InitAppListener</listener-class> </listener> <filter> <filter-name>HttpSessionSizeFilter</filter-name> <filter-class>lu.bourse.lxn.commun.HttpSessionSizeFilter</filter-class> </filter> <filter-mapping> <filter-name>HttpSessionSizeFilter</filter-name> <url-pattern>*.xhtml</url-pattern> </filter-mapping> <filter> <filter-name>Pretty Filter</filter-name> <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class> </filter> <filter-mapping> <filter-name>Pretty Filter</filter-name> <url-pattern>/fr/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>Pretty Filter</filter-name> <url-pattern>/en/*</url-pattern> </filter-mapping> <filter> <filter-name>LuxnextUrlFilter</filter-name> <filter-class>lu.bourse.lxn.commun.LuxnextUrlFilter</filter-class> </filter> <filter-mapping> <filter-name>LuxnextUrlFilter</filter-name> <url-pattern>*.html</url-pattern> </filter-mapping> <filter-mapping> <filter-name>LuxnextUrlFilter</filter-name> <url-pattern>*.xhtml</url-pattern> </filter-mapping> <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> <dispatcher>FORWARD</dispatcher> <dispatcher>REQUEST</dispatcher> </filter-mapping> <filter> <filter-name>RessourcesStaticFilter</filter-name> <filter-class>lu.bourse.lxn.commun.RessourcesStaticFilter</filter-class> </filter> <filter-mapping> <filter-name>RessourcesStaticFilter</filter-name> <url-pattern>/static_images/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>RessourcesStaticFilter</filter-name> <url-pattern>/static_docs/*</url-pattern> </filter-mapping> <filter> <display-name>RichFaces Filter</display-name> <filter-name>richfaces</filter-name> <filter-class>org.ajax4jsf.Filter</filter-class> <init-param> <param-name>forceparser</param-name> <param-value>false</param-value> </init-param> </filter> <filter-mapping> <filter-name>richfaces</filter-name> <servlet-name>Faces Servlet</servlet-name> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>INCLUDE</dispatcher> </filter-mapping> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.xhtml</url-pattern> </servlet-mapping> <filter> <filter-name>MyFacesExtensionsFilter</filter-name> <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class> <init-param> <param-name>maxFileSize</param-name> <param-value>20m</param-value> </init-param> </filter> <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages --> <filter-mapping> <filter-name>MyFacesExtensionsFilter</filter-name> <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry --> <servlet-name>Faces Servlet</servlet-name> </filter-mapping> <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) --> <filter-mapping> <filter-name>MyFacesExtensionsFilter</filter-name> <url-pattern>/faces/myFacesExtensionResource/*</url-pattern> </filter-mapping> <session-config> <session-timeout>10</session-timeout> </session-config> <welcome-file-list> <!-- Redirects to "welcome.htm" for dispatcher handling --> <welcome-file>start.jsp</welcome-file> </welcome-file-list> <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/templates/error.xhtml</location> </error-page> <error-page> <error-code>404</error-code> <location>/templates/error404.xhtml</location> </error-page> <error-page> <error-code>500</error-code> <location>/templates/error.xhtml</location> </error-page> <jsp-config> <jsp-property-group> <url-pattern>*.html</url-pattern> <page-encoding>ISO-8859-1</page-encoding> </jsp-property-group> </jsp-config> </web-app>