Version 22

    I have identified problems with starting with RichFaces Push recently on various containers,

    so I have started this article to help summarize configuration necessary.


    Refer to Links when more information needed.


    Please modify this article when you are missing configuration for container you are using,

    or comment when you are experiencing issues.






    RichFaces Push functionality depends on several features, which are briefly described here

    including instructions what to do when feature is not available on given container.


    Servlet Registration


    RichFaces Push requires PushServlet registered for web application in order to connect to container and listen for push requests.


    In Servlets 3.0 and higher environments, automatic servlet registration is prepared, so your servlet should be initialized automatically, so no actions required by end-user application.


    However in Servlets 2.5 and lower, servlet needs to be registered manually in web.xml:


    <!-- Push Servlet - listens for user sessions -->
        <servlet-name>Push Servlet</servlet-name>
        <servlet-name>Push Servlet</servlet-name>
    <!-- setups servlet-mapping in RichFaces configuration -->



    Note: When you are registering servlets in Servlets 3.0 environments manually, RichFaces will detect that servlet for Push is already registered and it avoid to initialize it again, however be sure to setup PushServlet to support asynchronous servlets, then modify servlet registration in previous web.xml snippet as follows:


        <servlet-name>Push Servlet</servlet-name>




    Asynchronous Servlets


    RichFaces uses Atmosphere to provide Push functionality, which is able to detect whenever it can use asynchronous servlets.


    However in some cases (you can find them in table bellow), you need to switch to use blocking I/O instead of asynchronous servlets:




    JMS Integration


    Warning: in RichFaces 4.2 Push has been refactored to turn off the JMS integration by default, you need to  use org.richfaces.push.jms.enable to enable it


    RichFaces Push (in 4.1) integrates with Java Message Service, which comes with Java EE 6 compatible application servers, however when using generic servlet container, you need to either setup JMS manually or you can turn JMS integration off using following web.xml configuration:




    You don't need to use JMS in order to push messages, you can use alternative approaches: CDI events  or TopicsContext interface.


    Push Initialization & Topics Creation


    Warning: in RichFaces 4.2, topics are created on demand (when they are access first), so no custom topic initialization is required, however you may need to initialize pushContext at startup (which was ensured by custom TopicsInitializer before: web.xml context-param - org.richfaces.push.initializeOnStartup))


    RichFaces 4.0 and 4.1 assume that topics needs to be created programatically before application is fully started.


    You can use following TopicsInitializer class code in your project and register it at JSF startup.




    package my.jsflisteners;
    import javax.faces.event.AbortProcessingException;
    import javax.faces.event.PostConstructApplicationEvent;
    import javax.faces.event.SystemEvent;
    import javax.faces.event.SystemEventListener;
    import org.richfaces.application.push.Topic;
    import org.richfaces.application.push.TopicKey;
    import org.richfaces.application.push.TopicsContext;
    import org.richfaces.application.push.impl.DefaultMessageDataSerializer;
    public class TopicsInitializer implements SystemEventListener {
        public void processEvent(SystemEvent event) throws AbortProcessingException {
            if (event instanceof PostConstructApplicationEvent) {
                try {
                    TopicsContext topicsContext = TopicsContext.lookup();
                    Topic pushTopic = topicsContext.getOrCreateTopic(new TopicKey("pushTopicsContext"));
                } catch (Exception e) {
                    throw new RuntimeException("Unable to initialize topics", e);
        public boolean isListenerForSource(Object source) {
            return true;





    <?xml version="1.0"?>
    <faces-config version="2.0" xmlns="" xmlns:xi=""
        xmlns:xsi="" xsi:schemaLocation="">







    Servlets API support and web.xml version


    Be aware that containers which supports Servlets 3.0 does select between Servlet API version in accordance to web.xml version - if you are using version 2.5 of web.xml, then you need to use configuration as if you container is supporting Servlet 2.5!


    web.xml header for Servlets 3.0:


    <web-app xmlns:xsi="" xmlns="" xmlns:web=""


    web.xml header for Servlets 2.5:


    <web-app xmlns:xsi="" xmlns="" xmlns:web=""


    Atmosphere version support


    If you are using Maven, be sure to use richfaces-bom to manage dependencies,


    but in case you are configuring dependencies manually, use following summary:


    • RichFaces 4.0
      • Atmosphere 0.6.5
    • RichFaces 4.1
      • Atmosphere 0.8.0-RC1
    • RichFaces 4.2
      • Atmosphere 0.8.4
    • RichFaces 4.3.0
      • Atmosphere 1.0.1
    • RichFaces 4.3.1
      • Atmosphere 1.0.10


    You can see BOM to determine current version.


    Note: Don't try to upgrade Atmosphere versions outside of defined scope. 1. Atmosphere versions have incompatible API, 2. RF uses jquery.atmosphere.js javascript library which is tied to specific Atmosphere runtime version.

    Container Support Table


    ContainerServlets APIPushServlet registrationAsynchronous servlets
    JBoss AS 63.0 Automatic bug, force to use blocking I/O
    JBoss AS 73.0 Automatic Yes
    Tomcat 73.0 issues (see comments)


    Jetty 62.5


    No, use blocking I/O

    Jetty 72.5


    No, use blocking I/O




    Following sources may help you with kicking off your project:

    Component Guide: a4j:push component

    Developer Guide

    Using RichFaces 4.1 push (CDI/TopicContext) for non-maven based projects

    Showcase: Samples of usage of a4j:push component