我打算开始在PrimeFaces 5.0中使用PrimeFaces Push。 我尝试使用Wildfly 8.1运行此处http://www.primefaces.org/showcase/push/notify.xhtml中找到的相同示例,但我无法从后端bean接收任何推送消息。
以下是我在wildfly控制台上的内容:
01:50:34,926 INFO [org.atmosphere.cpr.AtmosphereFramework](Thread-261)Atmosphere的JavaScript Client 2.2.2的最新版本 01:50:34,926 INFO [org.atmosphere.cpr.AtmosphereFramework](Thread-261)
Atmosphere 2.2.0-RC3的当前版本 最新版本的Atmosphere 2.1.7
01:50:37,447 ERROR [org.atmosphere.interceptor.JavaScriptProtocol](默认任务-61)无效大气版本2.2.0-javascript 01:50:37,448 WARN [org.atmosphere.websocket.protocol.SimpleHttpProtocol](默认任务-61)状态代码高于或等于400状态501消息正常 01:50:41,957 INFO [stdout](默认任务-62)发送信息
01:55:37,760 ERROR [org.atmosphere.cpr.AsynchronousProcessor](默认任务-63)无法取消资源:8cf3d711-00c2-4e52-9d78-97cd04c0b585:java.lang.NullPointerException 在org.primefaces.push.impl.PushEndpointHandlerProxy.onStateChange(PushEndpointHandlerProxy.java:241)[primefaces-5.0.jar:5.0] 在org.atmosphere.cpr.AsynchronousProcessor.invokeAtmosphereHandler(AsynchronousProcessor.java:492)[atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3] 在org.atmosphere.cpr.AsynchronousProcessor.completeLifecycle(AsynchronousProcessor.java:444)[atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3] 在org.atmosphere.cpr.AsynchronousProcessor.endRequest(AsynchronousProcessor.java:548)[atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3] 在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] 在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] 在java.lang.Thread.run(Thread.java:745)[rt.jar:1.7.0_55]
以下是PrimeFaces push的web.xml配置:
<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>
感谢您帮助解决此问题。
答案 0 :(得分:1)
使用Primefaces 5.0和Atmosphere Runtime 2.2.0我遇到了同样的问题。
解决了它,改为Atmosphere 2.1.7(根据日志输出仍然是最新版本)。现在推送消息很好......