3

Currently, we are migrating our JavaEE application from a Tomcat server to a Wildfly server. We encounter some problems. One of the biggest problems is that we do not get the Primefaces push under WebSockets with Atmopshere to run. We always fall back on long-polling. Chrome Netwerk Dump

As a test we have copied the following Git-Project: https://github.com/belalgalal/Blogging/tree/master/PrimePushNotify And make the following adjustments to the POM file.

...
<dependency>
    <groupId>org.atmosphere</groupId>
    <artifactId>atmosphere-runtime</artifactId>
    <version>2.4.12</version>
</dependency>
... 
<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>6.0</version>
</dependency>
...

Which settings or configuration must be made so that we can use Primefaces Push with Websockets?

Product summary:

  • IDE: Eclipse
  • Build: Maven
  • Server: Wildfly 10.1
  • Primefaces 6.0
  • Atmosphere 2.4.12

Trace-Dump-Atmosphere

12:02:39,791 INFO  [io.undertow.servlet] (ServerService Thread Pool -- 61) Initializing AtmosphereFramework
12:02:39,796 INFO  [org.atmosphere.util.IOUtils] (ServerService Thread Pool -- 61) Successfully loaded and installed META-INF/services/org.atmosphere.cpr.AtmosphereFramework
12:02:39,871 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 61) Mojarra 2.2.13.SP1 20160303-1204 für Kontext '/PrimePushNotify-0.0.1-SNAPSHOT' wird initialisiert.
12:02:40,916 INFO  [org.primefaces.webapp.PostConstructApplicationEventListener] (ServerService Thread Pool -- 61) Running on PrimeFaces 6.0
12:02:40,960 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Atmosphere is using org.atmosphere.cpr.DefaultAnnotationProcessor for processing annotation
12:02:40,960 INFO  [org.atmosphere.cpr.DefaultAnnotationProcessor] (ServerService Thread Pool -- 61) AnnotationProcessor class org.atmosphere.cpr.DefaultAnnotationProcessor$ServletContainerInitializerAnnotationProcessor being used
12:02:40,961 INFO  [org.atmosphere.cpr.AnnotationHandler] (ServerService Thread Pool -- 61) Found Annotation in class org.primefaces.push.impl.PushEndpointInterceptor being scanned: interface org.atmosphere.config.service.AtmosphereInterceptorService
12:02:40,962 INFO  [org.atmosphere.cpr.AnnotationHandler] (ServerService Thread Pool -- 61) Found Annotation in class org.primefaces.push.impl.PushEndpointMapper being scanned: interface org.atmosphere.config.service.EndpointMapperService
12:02:40,962 INFO  [org.atmosphere.cpr.AnnotationHandler] (ServerService Thread Pool -- 61) Found Annotation in class org.primefaces.push.impl.PushEndpointProcessor being scanned: interface org.atmosphere.config.AtmosphereAnnotation
12:02:40,966 INFO  [org.atmosphere.cpr.AnnotationHandler] (ServerService Thread Pool -- 61) Found Annotation in class com.ithinkisink.primepush.notify.NotifyResource being scanned: interface org.primefaces.push.annotation.PushEndpoint
12:02:40,976 INFO  [org.atmosphere.util.ForkJoinPool] (ServerService Thread Pool -- 61) Using ForkJoinPool  java.util.concurrent.ForkJoinPool. Set the org.atmosphere.cpr.broadcaster.maxAsyncWriteThreads to -1 to fully use its power.
12:02:40,981 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy mapped to context-path /notify and Broadcaster Class org.atmosphere.cpr.DefaultBroadcaster
12:02:40,981 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor [@PushEndpoint Interceptor] mapped to AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy
12:02:40,983 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Auto detecting WebSocketHandler in /WEB-INF/classes/
12:02:40,986 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol 
12:02:40,988 INFO  [org.atmosphere.container.JSR356AsyncSupport] (ServerService Thread Pool -- 61) JSR 356 Mapping path /primepush
12:02:40,990 INFO  [io.undertow.websockets.jsr] (ServerService Thread Pool -- 61) UT026005: Adding programmatic server endpoint class org.atmosphere.container.JSR356Endpoint for path /primepush
12:02:40,992 INFO  [io.undertow.websockets.jsr] (ServerService Thread Pool -- 61) UT026005: Adding programmatic server endpoint class org.atmosphere.container.JSR356Endpoint for path /primepush/{path0}
12:02:40,992 INFO  [io.undertow.websockets.jsr] (ServerService Thread Pool -- 61) UT026005: Adding programmatic server endpoint class org.atmosphere.container.JSR356Endpoint for path /primepush/{path0}/{path1}
12:02:40,992 INFO  [io.undertow.websockets.jsr] (ServerService Thread Pool -- 61) UT026005: Adding programmatic server endpoint class org.atmosphere.container.JSR356Endpoint for path /primepush/{path0}/{path1}/{path2}
12:02:40,992 INFO  [io.undertow.websockets.jsr] (ServerService Thread Pool -- 61) UT026005: Adding programmatic server endpoint class org.atmosphere.container.JSR356Endpoint for path /primepush/{path0}/{path1}/{path2}/{path3}
12:02:40,993 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installing Default AtmosphereInterceptors
12:02:40,993 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61)   org.atmosphere.interceptor.CorsInterceptor : CORS Interceptor Support
12:02:40,993 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61)   org.atmosphere.interceptor.CacheHeadersInterceptor : Default Response's Headers Interceptor
12:02:40,994 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61)   org.atmosphere.interceptor.PaddingAtmosphereInterceptor : Browser Padding Interceptor Support
12:02:40,994 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61)   org.atmosphere.interceptor.AndroidAtmosphereInterceptor : Android Interceptor Support
12:02:40,996 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61)   org.atmosphere.interceptor.HeartbeatInterceptor : Heartbeat Interceptor Support
12:02:40,996 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61)   org.atmosphere.interceptor.SSEAtmosphereInterceptor : SSE Interceptor Support
12:02:40,997 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61)   org.atmosphere.interceptor.JSONPAtmosphereInterceptor : JSONP Interceptor Support
12:02:40,997 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61)   org.atmosphere.interceptor.JavaScriptProtocol : Atmosphere JavaScript Protocol
12:02:40,998 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61)   org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor : org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor
12:02:40,998 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61)   org.atmosphere.interceptor.OnDisconnectInterceptor : Browser disconnection detection
12:02:40,998 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61)   org.atmosphere.interceptor.IdleResourceInterceptor : org.atmosphere.interceptor.IdleResourceInterceptor
12:02:40,999 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Set org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults to disable them.
12:02:40,999 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor Atmosphere LifeCycle with priority AFTER_DEFAULT 
12:02:40,999 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor  Track Message Size Interceptor using | with priority BEFORE_DEFAULT 
12:02:41,000 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor @PushEndpoint Interceptor with priority AFTER_DEFAULT 
12:02:41,000 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor CORS Interceptor Support with priority FIRST_BEFORE_DEFAULT 
12:02:41,000 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor Default Response's Headers Interceptor with priority AFTER_DEFAULT 
12:02:41,000 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor Browser Padding Interceptor Support with priority AFTER_DEFAULT 
12:02:41,001 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor Android Interceptor Support with priority AFTER_DEFAULT 
12:02:41,001 INFO  [org.atmosphere.interceptor.HeartbeatInterceptor] (ServerService Thread Pool -- 61) HeartbeatInterceptor configured with padding value 'X', client frequency 60 seconds and server frequency 0 seconds
12:02:41,001 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor Heartbeat Interceptor Support with priority AFTER_DEFAULT 
12:02:41,001 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor SSE Interceptor Support with priority AFTER_DEFAULT 
12:02:41,001 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor JSONP Interceptor Support with priority AFTER_DEFAULT 
12:02:41,001 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor Atmosphere JavaScript Protocol with priority AFTER_DEFAULT 
12:02:41,001 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor with priority AFTER_DEFAULT 
12:02:41,001 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor Browser disconnection detection with priority AFTER_DEFAULT 
12:02:41,002 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Installed AtmosphereInterceptor org.atmosphere.interceptor.IdleResourceInterceptor with priority BEFORE_DEFAULT 
12:02:41,002 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Using EndpointMapper class org.primefaces.push.impl.PushEndpointMapper
12:02:41,002 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Using BroadcasterCache: org.atmosphere.cache.UUIDBroadcasterCache
12:02:41,002 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Default Broadcaster Class: org.atmosphere.cpr.DefaultBroadcaster
12:02:41,002 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Broadcaster Shared List Resources: false
12:02:41,003 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Broadcaster Polling Wait Time 100
12:02:41,003 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Shared ExecutorService supported: true
12:02:41,003 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Messaging ExecutorService Pool Size unavailable - Not instance of ThreadPoolExecutor
12:02:41,003 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Async I/O Thread Pool Size: 200
12:02:41,003 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Using BroadcasterFactory: org.atmosphere.cpr.DefaultBroadcasterFactory
12:02:41,003 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Using AtmosphereResurceFactory: org.atmosphere.cpr.DefaultAtmosphereResourceFactory
12:02:41,003 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Using WebSocketProcessor: org.atmosphere.websocket.DefaultWebSocketProcessor
12:02:41,007 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Invoke AtmosphereInterceptor on WebSocket message true
12:02:41,007 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) HttpSession supported: false
12:02:41,007 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Atmosphere is using org.atmosphere.inject.InjectableObjectFactory for dependency injection and object creation
12:02:41,007 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Atmosphere is using async support: org.atmosphere.container.JSR356AsyncSupport running under container: WildFly 2.2.0.Final - 1.4.0.Final using javax.servlet/3.0 and jsr356/WebSocket API
12:02:41,008 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) Atmosphere Framework 2.4.12 started.
12:02:41,008 INFO  [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 61) 

    For Atmosphere Framework Commercial Support, visit 
    http://www.async-io.org/ or send an email to support@async-io.org

12:02:41,013 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 61) WFLYUT0021: Registered web context: /PrimePushNotify-0.0.1-SNAPSHOT
12:02:41,035 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "ojdbc7-driver" (runtime-name : "ojdbc7-12.1.0.2.jar")
12:02:41,053 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "PrimePushNotify-0.0.1-SNAPSHOT.war" (runtime-name : "PrimePushNotify-0.0.1-SNAPSHOT.war")
12:02:41,168 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
12:02:41,168 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
12:02:41,169 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started in 7760ms - Started 497 of 751 services (413 services are lazy, passive or on-demand)
12:02:41,275 INFO  [org.atmosphere.cpr.AtmosphereFramework] (Thread-90) Latest version of Atmosphere's JavaScript Client 2.3.1
Kukeltje
  • 12,223
  • 4
  • 24
  • 47
Dominic Weiser
  • 1,446
  • 1
  • 20
  • 32
  • Your title is a concatenation of the tags... Can you improve it? And is there anything in the logging while starting up that is an indication of 'problems'? – Kukeltje Jun 02 '17 at 10:38
  • I've added a Trace-Dump, but I can't see any errors. – Dominic Weiser Jun 02 '17 at 11:55
  • I improved your title – Kukeltje Jun 02 '17 at 12:06
  • Is this problem happening under local development, or is it already in production? – Bonifacio Jun 02 '17 at 14:04
  • Currently we only run server locally. We wanted to check if everything works before we install it productive. – Dominic Weiser Jun 02 '17 at 15:45
  • We once hada problem like this. Turned out the problem was nginx blocking long time pending requests. However, if you are still on development stage I can't think in any solution at the moment, sorry :( – Bonifacio Jun 02 '17 at 16:40
  • Have you checked Browser compatibility as well? https://github.com/Atmosphere/atmosphere/wiki/Supported-WebServers-and-Browsers I also remember, that we had problems with Atmosphere/Wildfly... In a very very dark corner of my brain I remember that the key was to modify the pom, so that a "certain" version of atmosphere and a certain version of jboss-websockets was used. (But that was back with Wildfly 8.x) – dognose Jun 02 '17 at 18:36
  • many thanks for the support. Unfortunately, Wildfly 10 is not yet listed in the wiki. As browsers we use Chrome, Firefox and Internet Explorer (depending on customer) had with the browsers under Tomcat but so far no problems. – Dominic Weiser Jun 02 '17 at 20:31

0 Answers0