Search code examples
jsf-2primefacesatmosphereprimepush

PrimeFaces Push 5.0 with Wildfly 8.1 not working


I'm planning to start using PrimeFaces Push coming with PrimeFaces 5.0. I've tried to run the same example found here http://www.primefaces.org/showcase/push/notify.xhtml using Wildfly 8.1 but I can't receive any push message from backend bean.

Here is what I've on wildfly console :

01:50:34,926 INFO [org.atmosphere.cpr.AtmosphereFramework] (Thread-261) Latest version of Atmosphere's JavaScript Client 2.2.2 01:50:34,926 INFO [org.atmosphere.cpr.AtmosphereFramework] (Thread-261)

Current version of Atmosphere 2.2.0-RC3 Newest version of Atmosphere available 2.1.7

01:50:37,447 ERROR [org.atmosphere.interceptor.JavaScriptProtocol] (default task-61) Invalid Atmosphere Version 2.2.0-javascript 01:50:37,448 WARN [org.atmosphere.websocket.protocol.SimpleHttpProtocol] (default task-61) Status code higher or equal than 400 Status 501 Message OK 01:50:41,957 INFO [stdout] (default task-62) sending message

01:55:37,760 ERROR [org.atmosphere.cpr.AsynchronousProcessor] (default task-63) Failed to cancel resource: 8cf3d711-00c2-4e52-9d78-97cd04c0b585: java.lang.NullPointerException at org.primefaces.push.impl.PushEndpointHandlerProxy.onStateChange(PushEndpointHandlerProxy.java:241) [primefaces-5.0.jar:5.0] at org.atmosphere.cpr.AsynchronousProcessor.invokeAtmosphereHandler(AsynchronousProcessor.java:492) [atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3] at org.atmosphere.cpr.AsynchronousProcessor.completeLifecycle(AsynchronousProcessor.java:444) [atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3] at org.atmosphere.cpr.AsynchronousProcessor.endRequest(AsynchronousProcessor.java:548) [atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3] at org.atmosphere.websocket.DefaultWebSocketProcessor.executeClose(DefaultWebSocketProcessor.java:676) [atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3] at org.atmosphere.websocket.DefaultWebSocketProcessor.close(DefaultWebSocketProcessor.java:628) [atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3] at org.atmosphere.container.JSR356Endpoint.onClose(JSR356Endpoint.java:221) [atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3] at io.undertow.websockets.jsr.UndertowSession.close(UndertowSession.java:181) [undertow-websockets-jsr-1.0.15.Final.jar:1.0.15.Final] at io.undertow.websockets.jsr.UndertowSession.close(UndertowSession.java:171) [undertow-websockets-jsr-1.0.15.Final.jar:1.0.15.Final] at io.undertow.websockets.jsr.FrameHandler$1.run(FrameHandler.java:93) [undertow-websockets-jsr-1.0.15.Final.jar:1.0.15.Final] at io.undertow.websockets.jsr.ServerWebSocketContainer$1.run(ServerWebSocketContainer.java:303) [undertow-websockets-jsr-1.0.15.Final.jar:1.0.15.Final] at io.undertow.websockets.jsr.OrderedExecutor$ExecutorTask.run(OrderedExecutor.java:49) [undertow-websockets-jsr-1.0.15.Final.jar:1.0.15.Final] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_55]

Here is my web.xml configuration for PrimeFaces push:

   <context-param>
           <param-name>primefaces.PUSH_SERVER_URL</param-name>
           <param-value>http://127.0.0.1:8080</param-value>
   </context-param>

   <servlet>
           <servlet-name>Push Servlet</servlet-name>
           <servlet-class>org.primefaces.push.PushServlet</servlet-class>
           <load-on-startup>0</load-on-startup>
           <async-supported>true</async-supported>
   </servlet>

   <servlet-mapping>
           <servlet-name>Push Servlet</servlet-name>
           <url-pattern>/primepush/*</url-pattern>
   </servlet-mapping>

I appreciate your help to solve this issue.


Solution

  • I had the same problem using Primefaces 5.0 and Atmosphere Runtime 2.2.0.

    Solved it, by changing to Atmosphere 2.1.7 (which is still the newest version according to log output). Now push messages work fine...