2 Replies Latest reply on Feb 18, 2013 6:03 PM by bretwil31

    a4j:push configuration issue

    bretwil31

      Hello,

      I'm having trouble getting a4j:push to work. My environment:

      tomcat 6, myfaces, RichFaces 4.3 Final. Its a simply demo app for the push component

       

      -> Using Atmosphere 1.0.1 as recommended at https://community.jboss.org/wiki/StartingWithRichFacesPushOnVariousServletContainers. Immediately I get start up exception:


      Caused by:

      java.lang.ClassNotFoundException
      : org.jboss.servlet.http.HttpEventServlet

       

      After some googling I find that I need also a compatibility library, so I add:

      -> atmosphere-compat-tomcat-1.0.1.jar. I still have the same exception.

      After more googling I find an obscure post that happens to mention they needed ALL atmosphere compatibility libraries, although there is no evidence elsewhere on the net that this is the case, I add:

      -> atmosphere-compat-tomcat7-1.0.1.jar (even though I'm using tomcat 6)
      -> atmosphere-compat-jbossweb-1.0.1.jar

      Now at least the demo page loads and my application starts up but I get the following exception and push does not work:

      SEVERE: Servlet.service() for servlet Push Servlet threw exception
      org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for /__richfaces_push
      at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:370)
      at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:206)
      at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166)
      at org.atmosphere.container.BlockingIOCometSupport.service(BlockingIOCometSupport.java:101)
      at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1305)
      at org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:293)
      at org.atmosphere.cpr.AtmosphereServlet.doGet(AtmosphereServlet.java:279)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      at java.lang.Thread.run(Thread.java:662)


      web.xml config is as recommended:

      <!-- Push Servlet - listens for user sessions -->
      <servlet>
      <servlet-name>Push Servlet</servlet-name>
      <servlet-class>org.richfaces.webapp.PushServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
      <servlet-name>Push Servlet</servlet-name>
      <url-pattern>/__richfaces_push</url-pattern>
      </servlet-mapping>

      <!-- setups servlet-mapping in RichFaces configuration -->
      <context-param>
      <param-name>org.richfaces.push.handlerMapping</param-name>
      <param-value>/__richfaces_push</param-value>
      </context-param>

       


      thanks for any feedback

        • 1. Re: a4j:push configuration issue
          lfryc

          Hey Brett,

           

          I guess the handler registration failed, so diving deeply into logs before the failure mentioned above could help here.

           

          However what you can do is attaching your WAR demo,

           

          and trying to copy setup from working sample:

           

          WAR: https://repository.jboss.org/nexus/service/local/artifact/maven/redirect?r=releases&g=org.richfaces.examples&a=push-demo&v=4.3.0.Final&e=war

          Maven project source: https://github.com/richfaces/dev-examples/tree/develop/push-demo

          1 of 1 people found this helpful
          • 2. Re: a4j:push configuration issue
            bretwil31

            hi Lukas,

            Thanks for the reply.  I downloaded the richfaces showcase 4.3 for tomcat 6, observed push working in my development environment so I've compared configuration in my demo project with richfaces showcase and ended up replacing in web.xml the recommended settings:

             

            <servlet>
                 <servlet-name>Push Servlet</servlet-name>
                 <servlet-class>org.richfaces.webapp.PushServlet</servlet-class>
                 <load-on-startup>1</load-on-startup>
            </servlet>
            <servlet-mapping>
                 <servlet-name>Push Servlet</servlet-name>
                 <url-pattern>/__richfaces_push</url-pattern>
            </servlet-mapping>

            <!-- setups servlet-mapping in RichFaces configuration -->
            <context-param>
                 <param-name>org.richfaces.push.handlerMapping</param-name>
                 <param-value>/__richfaces_push</param-value>
            </context-param>

             

             

            With showcase settings:

             

             

             

             

             

             

             

             

             

             

            <filter>
                    <filter-name>PushFilter</filter-name>
                    <filter-class>org.richfaces.webapp.PushFilter</filter-class>
                    <async-supported>true</async-supported>
            </filter>
            <filter-mapping>
                    <filter-name>PushFilter</filter-name>
                    <servlet-name>Faces Servlet</servlet-name>
            </filter-mapping>

             

             

            And it works! I'm not sure if this is tomcat specific or documentation needs updating.

             

            Brett