Monday, August 20, 2012

Enable failover with OpenWebBeans (> 1.1.3)

With Tomcat 7.0.22, some changes has be done when


will be called. This caused that session replication was done before OpenWebBeans prepared the beans for the failover.

Therefore a new ServletFilter, which prepares the bean failover before session replication, was added in OpenWebBeans 1.1.4.

Just add it as FIRST filter in your web.xml:


and map it for example to the FacesServlet.

Also don't forget the src/main/resources/META-INF/openwebbeans/ with following entries:


Update for OWB 1.2.0 -> Click


  1. Interesting, thanks for sharing. Do you know of any good tutorials/blogs on how to do session replication, clustering, load balancing with latest Tomcat or TomEE version?

  2. Just read the tomcat docu about clustering, enable myfaces session serialization and OWB failover.
    You may also configure MyFaces state encryption if you use it, because the keys will be generated on startup otherwise.

  3. Noted. Thanks.

    David Blevins was encouraging me to run 2 copies of the web app on one server and create a L2 cache; I'm assuming/hoping that both copies of the web app are hitting the same database.

    This is something I want to do, ASAP, and I have already started reading/researching this, and that includes the tomcat cluster session replication documentation.

  4. Thanks! This is very helpful.

    You have a typo

    Also, how about adding "clustering" for a label (if that even effects search hits)