PF 5 Counter showcase example on Glassfish 3.1.2.8

UI Components for JSF
Post Reply
tdevos
Posts: 60
Joined: 29 Mar 2011, 09:12

10 Jun 2014, 15:33

Hi,

I'm trying to deploy the showcase on GF 3.1.2.8. However, I can not get it to work. Here's what I did:

I used the default web.xml from the showcase and changed the section:

Code: Select all

    <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>
to

Code: Select all

    <servlet>
        <servlet-name>Push Servlet</servlet-name>
        <servlet-class>org.primefaces.push.PushServlet</servlet-class>
        <init-param>
        	<param-name>org.atmosphere.cpr.broadcasterCacheClass</param-name>
        	<param-value>org.atmosphere.cache.UUIDBroadcasterCache</param-value>
    	  </init-param>
        <load-on-startup>0</load-on-startup>        
        <async-supported>true</async-supported>
    </servlet>
- Enabled comet and websocket support on the HTTP listeners.

Whenever I click on the "click" button the counter does not increase. However I don't see any error:

In the logs I see during startup (trace-logging enabled):

Code: Select all

INFO: Running on PrimeFaces 5.0
INFO: 10-06-2014 15:25:21 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Atmosphere LifeCycle with priority AFTER_DEFAULT 
INFO: 10-06-2014 15:25:21 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor  Track Message Size Interceptor using | with priority BEFORE_DEFAULT 
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AtmosphereFramework - org.atmosphere.cdi.CDIObjectFactory not found
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AtmosphereFramework - org.atmosphere.spring.SpringObjectFactory not found
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AtmosphereFramework - org.atmosphere.guice.GuiceObjectFactory not found
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AtmosphereFramework - ObjectFactory already set to org.primefaces.push.impl.PushObjectFactory@d801f2c
INFO: 10-06-2014 15:25:21 INFO  org.atmosphere.cpr.AtmosphereFramework - Atmosphere is using org.atmosphere.cpr.DefaultAnnotationProcessor for processing annotation
INFO: 10-06-2014 15:25:21 INFO  org.atmosphere.cpr.DefaultAnnotationProcessor - AnnotationProcessor class org.atmosphere.cpr.DefaultAnnotationProcessor$ServletContainerInitializerAnnotationProcessor being used
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.primefaces.push.impl.PushEndpointProcessor associated with interface org.primefaces.push.annotation.PushEndpoint
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.AsyncSupportServiceProcessor associated with interface org.atmosphere.config.service.AsyncSupportService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.WebSocketProtocolServiceProcessor associated with interface org.atmosphere.config.service.WebSocketProtocolService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.AsyncSupportListenerServiceProcessor associated with interface org.atmosphere.config.service.AsyncSupportListenerService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.BroadcasterFactoryServiceProcessor associated with interface org.atmosphere.config.service.BroadcasterFactoryService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.BroadcasterCacheServiceProcessor associated with interface org.atmosphere.config.service.BroadcasterCacheService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.WebSocketProcessorServiceProcessor associated with interface org.atmosphere.config.service.WebSocketProcessorService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.AtmosphereHandlerServiceProcessor associated with interface org.atmosphere.config.service.AtmosphereHandlerService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.AtmosphereInterceptorServiceProcessor associated with interface org.atmosphere.config.service.AtmosphereInterceptorService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.MeteorServiceProcessor associated with interface org.atmosphere.config.service.MeteorService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.BroadcasterServiceProcessor associated with interface org.atmosphere.config.service.BroadcasterService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.BroadcastFilterServiceProcessor associated with interface org.atmosphere.config.service.BroadcasterFilterService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.BroadcasterCacheInspectorServiceProcessor associated with interface org.atmosphere.config.service.BroadcasterCacheInspectorService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.BroadcasterListenerServiceProcessor associated with interface org.atmosphere.config.service.BroadcasterListenerService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.EndpointMapperServiceProcessor associated with interface org.atmosphere.config.service.EndpointMapperService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.WebSocketHandlerServiceProcessor associated with interface org.atmosphere.config.service.WebSocketHandlerService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.AtmosphereServiceProcessor associated with interface org.atmosphere.config.service.AtmosphereService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Processor class org.atmosphere.annotation.ManagedServiceProcessor associated with interface org.atmosphere.config.service.ManagedService
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Annotation interface org.atmosphere.config.service.EndpointMapperService handled by org.atmosphere.annotation.EndpointMapperServiceProcessor
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.AnnotationHandler - Annotation interface org.atmosphere.config.service.AtmosphereInterceptorService handled by org.atmosphere.annotation.AtmosphereInterceptorServiceProcessor
INFO: 10-06-2014 15:25:21 INFO  org.atmosphere.cpr.DefaultAnnotationProcessor - Found Annotation in org.primefaces.showcase.push.browser.BrowserStatsResource being scanned: interface org.primefaces.push.annotation.PushEndpoint
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - About to create /browser
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Looking in the store using /browser returned null
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.util.ServletProxyFactory - Method setHeader not supported
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.DefaultBroadcaster - /browser new lifecycle policy: NEVER
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - About to create /browser
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Looking in the store using /browser returned null
INFO: 10-06-2014 15:25:21 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Broadcaster /browser was created 	Name: /browser	AtmosphereResource: 0	BroadcasterCache org.atmosphere.cache.UUIDBroadcasterCache
INFO: 10-06-2014 15:25:21 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy mapped to context-path /browser and Broadcaster Class org.atmosphere.cpr.DefaultBroadcaster
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor [@PushEndpoint Interceptor] mapped to AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.AnnotationHandler - Annotation interface org.primefaces.push.annotation.PushEndpoint handled by org.primefaces.push.impl.PushEndpointProcessor
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.DefaultAnnotationProcessor - Found Annotation in org.primefaces.showcase.push.chat.ChatResource being scanned: interface org.primefaces.push.annotation.PushEndpoint
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - About to create /{room}/{user}
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Looking in the store using /{room}/{user} returned null
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.util.ServletProxyFactory - Method setHeader not supported
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcaster - /{room}/{user} new lifecycle policy: NEVER
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - About to create /{room}/{user}
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Looking in the store using /{room}/{user} returned null
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Broadcaster /{room}/{user} was created 	Name: /{room}/{user}	AtmosphereResource: 0	BroadcasterCache org.atmosphere.cache.UUIDBroadcasterCache
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy mapped to context-path /{room}/{user} and Broadcaster Class org.atmosphere.cpr.DefaultBroadcaster
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor [@PushEndpoint Interceptor] mapped to AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.AnnotationHandler - Annotation interface org.primefaces.push.annotation.PushEndpoint handled by org.primefaces.push.impl.PushEndpointProcessor
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.DefaultAnnotationProcessor - Found Annotation in org.primefaces.showcase.push.checkin.CheckinResource being scanned: interface org.primefaces.push.annotation.PushEndpoint
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - About to create /checkin
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Looking in the store using /checkin returned null
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.util.ServletProxyFactory - Method setHeader not supported
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcaster - /checkin new lifecycle policy: NEVER
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - About to create /checkin
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Looking in the store using /checkin returned null
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Broadcaster /checkin was created 	Name: /checkin	AtmosphereResource: 0	BroadcasterCache org.atmosphere.cache.UUIDBroadcasterCache
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy mapped to context-path /checkin and Broadcaster Class org.atmosphere.cpr.DefaultBroadcaster
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor [@PushEndpoint Interceptor] mapped to AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.AnnotationHandler - Annotation interface org.primefaces.push.annotation.PushEndpoint handled by org.primefaces.push.impl.PushEndpointProcessor
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.DefaultAnnotationProcessor - Found Annotation in org.primefaces.showcase.push.counter.CounterResource being scanned: interface org.primefaces.push.annotation.PushEndpoint
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - About to create /counter
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Looking in the store using /counter returned null
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.util.ServletProxyFactory - Method setHeader not supported
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcaster - /counter new lifecycle policy: NEVER
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - About to create /counter
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Looking in the store using /counter returned null
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Broadcaster /counter was created 	Name: /counter	AtmosphereResource: 0	BroadcasterCache org.atmosphere.cache.UUIDBroadcasterCache
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy mapped to context-path /counter and Broadcaster Class org.atmosphere.cpr.DefaultBroadcaster
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor [@PushEndpoint Interceptor] mapped to AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.AnnotationHandler - Annotation interface org.primefaces.push.annotation.PushEndpoint handled by org.primefaces.push.impl.PushEndpointProcessor
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.DefaultAnnotationProcessor - Found Annotation in org.primefaces.showcase.push.notify.NotifyResource being scanned: interface org.primefaces.push.annotation.PushEndpoint
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - About to create /notify
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Looking in the store using /notify returned null
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.util.ServletProxyFactory - Method setHeader not supported
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcaster - /notify new lifecycle policy: NEVER
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - About to create /notify
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Looking in the store using /notify returned null
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Broadcaster /notify was created 	Name: /notify	AtmosphereResource: 0	BroadcasterCache org.atmosphere.cache.UUIDBroadcasterCache
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy mapped to context-path /notify and Broadcaster Class org.atmosphere.cpr.DefaultBroadcaster
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor [@PushEndpoint Interceptor] mapped to AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.AnnotationHandler - Annotation interface org.primefaces.push.annotation.PushEndpoint handled by org.primefaces.push.impl.PushEndpointProcessor
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.DefaultAnnotationProcessor - Found Annotation in org.primefaces.showcase.push.viewparam.ViewParamResource being scanned: interface org.primefaces.push.annotation.PushEndpoint
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - About to create /viewparam
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Looking in the store using /viewparam returned null
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.util.ServletProxyFactory - Method setHeader not supported
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcaster - /viewparam new lifecycle policy: NEVER
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - About to create /viewparam
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Looking in the store using /viewparam returned null
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Broadcaster /viewparam was created 	Name: /viewparam	AtmosphereResource: 0	BroadcasterCache org.atmosphere.cache.UUIDBroadcasterCache
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy mapped to context-path /viewparam and Broadcaster Class org.atmosphere.cpr.DefaultBroadcaster
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor [@PushEndpoint Interceptor] mapped to AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.AnnotationHandler - Annotation interface org.primefaces.push.annotation.PushEndpoint handled by org.primefaces.push.impl.PushEndpointProcessor
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Auto detecting WebSocketHandler in /WEB-INF/classes/
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol 
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installing Default AtmosphereInterceptor
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.CorsInterceptor : CORS Interceptor Support
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.CacheHeadersInterceptor : Default Response's Headers Interceptor
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.PaddingAtmosphereInterceptor : Browser Padding Interceptor Support
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.AndroidAtmosphereInterceptor : Android Interceptor Support
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.HeartbeatInterceptor : Heartbeat Interceptor Support
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.SSEAtmosphereInterceptor : SSE Interceptor Support
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.JSONPAtmosphereInterceptor : JSONP Interceptor Support
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.JavaScriptProtocol : Atmosphere JavaScript Protocol
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor : org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.OnDisconnectInterceptor : Browser disconnection detection
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.IdleResourceInterceptor : org.atmosphere.interceptor.IdleResourceInterceptor
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor  Track Message Size Interceptor using | with priority BEFORE_DEFAULT 
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Atmosphere LifeCycle with priority AFTER_DEFAULT 
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Set org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults to disable them.
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Using EndpointMapper class org.primefaces.push.impl.PushEndpointMapper
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Using BroadcasterCache: org.atmosphere.cache.UUIDBroadcasterCache
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Default Broadcaster Class: org.atmosphere.cpr.DefaultBroadcaster
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Broadcaster Polling Wait Time 100
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Shared ExecutorService supported: true
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - About to create /*
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Looking in the store using /* returned null
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.util.ServletProxyFactory - Method setHeader not supported
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcaster - /* new lifecycle policy: NEVER
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - About to create /*
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Looking in the store using /* returned null
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.cpr.DefaultBroadcasterFactory - Broadcaster /* was created 	Name: /*	AtmosphereResource: 0	BroadcasterCache org.atmosphere.cache.UUIDBroadcasterCache
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Messaging Thread Pool Size: Unlimited
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Async I/O Thread Pool Size: 200
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Using BroadcasterFactory: org.atmosphere.cpr.DefaultBroadcasterFactory
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Using WebSocketProcessor: org.atmosphere.websocket.DefaultWebSocketProcessor
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - HttpSession supported: false
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Atmosphere is using org.primefaces.push.impl.PushObjectFactory@d801f2c for dependency injection and object creation
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Atmosphere is using async support: org.atmosphere.container.GrizzlyServlet30WebSocketSupport running under container: Oracle GlassFish Server 3.1.2.8 with WebSocket enabled.
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Atmosphere Framework 2.1.3 started.
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - 	For Atmosphere Framework Commercial Support, visit 	http://www.async-io.org/ or send an email to support@async-io.org
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor @PushEndpoint Interceptor with priority AFTER_DEFAULT 
INFO: WEB0671: Loading application [showcase-5.0] at [/showcase-5.0]
INFO: showcase-5.0 was successfully deployed in 6.327 milliseconds.
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - Latest version of Atmosphere's JavaScript Client 2.2.0
INFO: 10-06-2014 15:25:22 INFO  org.atmosphere.cpr.AtmosphereFramework - 	Current version of Atmosphere 2.1.3 	Newest version of Atmosphere available 2.1.5
INFO: 10-06-2014 15:25:22 TRACE org.atmosphere.util.analytics.HTTPGetMethod - JGoogleAnalytics: Tracking Successful
On a click:

Code: Select all

INFO: 10-06-2014 15:26:58 TRACE org.atmosphere.util.DefaultEndpointMapper - Trying to map /primepush/[a-zA-Z0-9-&\.*_~=@;\\?]+ to /primepush/counter
INFO: 10-06-2014 15:26:58 TRACE org.atmosphere.util.DefaultEndpointMapper - Mapped /primepush/[a-zA-Z0-9-&\.*_~=@;\\?]+ to true
INFO: 10-06-2014 15:26:58 TRACE org.atmosphere.websocket.DefaultWebSocketProcessor - Processing request com.sun.grizzly.websockets.ServerNetworkHandler$WSServletRequestImpl@106db2d6
INFO: 10-06-2014 15:26:58 TRACE org.atmosphere.cpr.AtmosphereFramework - Query String translated to headers {X-Atmosphere-Transport=websocket, X-Atmosphere-Framework=2.2.0-javascript, X-Atmosphere-TrackMessageSize=true, X-atmo-protocol=true, X-Atmosphere-tracking-id=0, X-Cache-Date=0}
INFO: 10-06-2014 15:26:59 TRACE org.atmosphere.cpr.MetaBroadcaster - Map /counter
INFO: 10-06-2014 15:26:59 TRACE org.atmosphere.cpr.MetaBroadcaster - Trying to map /counter to /notify
INFO: 10-06-2014 15:26:59 TRACE org.atmosphere.cpr.MetaBroadcaster - Trying to map /counter to /counter
INFO: 10-06-2014 15:26:59 TRACE org.atmosphere.cpr.MetaBroadcaster - Trying to map /counter to /browser
INFO: 10-06-2014 15:26:59 TRACE org.atmosphere.cpr.MetaBroadcaster - Trying to map /counter to /{room}/{user}
INFO: 10-06-2014 15:26:59 TRACE org.atmosphere.cpr.MetaBroadcaster - Trying to map /counter to /checkin
INFO: 10-06-2014 15:26:59 TRACE org.atmosphere.cpr.MetaBroadcaster - Trying to map /counter to /viewparam
INFO: 10-06-2014 15:26:59 TRACE org.atmosphere.cpr.MetaBroadcaster - Trying to map /counter to /*
INFO: 10-06-2014 15:26:59 TRACE org.atmosphere.cpr.DefaultBroadcaster - /counter is about to broadcast Entry{message=1, type=ALL, future=org.atmosphere.cpr.BroadcasterFuture@23580011}
INFO: 10-06-2014 15:26:59 TRACE org.atmosphere.cache.UUIDBroadcasterCache - Adding for AtmosphereResource null cached messages 1
INFO: 10-06-2014 15:26:59 TRACE org.atmosphere.cache.UUIDBroadcasterCache - Active clients {}
Am I doing something wrong?

Using Primefaces 5.0 and Atmosphere 2.1.3

Thanks in advance for replying!

tdevos
Posts: 60
Joined: 29 Mar 2011, 09:12

10 Jun 2014, 22:25

Additional information:

If I force the transport to "long-polling" like:

Code: Select all

<p:socket onMessage="handleMessage" channel="/counter" transport="long-polling"/>
everything seems to work perfectly. However, since websockets are more appropriate I would like to use them.

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

11 Jun 2014, 18:28

can you share 'all' of your PrimeFaces Push counter xhtml 'and' java bean code?

also, can you reply with your entire web.xml? i want to see if you are using servlet 3 and all of your PrimeFaces Push servlet config in web.xml (you did not share all of it, yet), so i need to see your entire web.xml. thanks.

also, see the following as i think there is a grizzly (glassfish websocket API) update available that might fix this issue for you.

quote from PF5 Push and Glassfish 4 works
leolux wrote:I like to report that primefaces 5 push + glassfish 4 works for me using the nightly build of glassfish 4 from 2th June 2014 with activated comet-support on both http-listeners and using the current version of atmosphere 2.1.5 from
http://search.maven.org/#search|gav|1|g ... runtime%22

I tested it successfully with Firefox version 29.0.1

P.S. Primefaces rocks. Keept it up!
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

tdevos
Posts: 60
Joined: 29 Mar 2011, 09:12

11 Jun 2014, 20:53

Hi,

Thanks for your time and reply.

Unfortunatly our customer does not allow us to update to Glassfish 4. Now I realise there where some problems on GF 3.1.2.2 with websockets as can be found in https://java.net/jira/browse/GRIZZLY-1289.

But this is about fix version 1.9.51, and we have 1.9.57 (we have the latest Glassfish patches installed), ie. GF 3.1.2.8. Now I don't see errors like described in that isssue so I think it is fixed.

As a looked into the source code of Atmosphere the Grizzly 2.x branch is a complete revamp of Grizzly 1.x so they are not compatible with each other.

Now I noticed another strange thing. If I deploy the chat example from the Atmosphere website, the websockets work perfectly. However, when I use PF push, they don't. So it must be something in the Primefaces layer and not Atmosphere related.

Here is the complete source of my (very small) project:

CounterResource.java

Code: Select all

package org.primefaces.showcase.push.counter;

import org.primefaces.push.annotation.OnMessage;
import org.primefaces.push.annotation.PushEndpoint;
import org.primefaces.push.impl.JSONEncoder;

@PushEndpoint("/counter")
public class CounterResource {

    @OnMessage(encoders = {JSONEncoder.class})
    public String onMessage(String count) {
        return count;
    }
}
GlobalCounterView.java

Code: Select all

package org.primefaces.showcase.push.counter;

import java.io.Serializable;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
import org.primefaces.push.EventBus;
import org.primefaces.push.EventBusFactory;

@ManagedBean(name = "globalCounterView")
@ApplicationScoped
public class GlobalCounterView implements Serializable{

    private volatile int count;

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public void increment() {
        count++;

        EventBus eventBus = EventBusFactory.getDefault().eventBus();
        eventBus.publish("/counter", String.valueOf(count));
    }
}
counter.xhtml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui" 
	xmlns:u="http://ubench.com">

	<h:head>
		<title><ui:insert name="UBench International" /></title>
	</h:head>
	
	<h:body>
		<h:form id="form">
			<h:outputText id="out" value="#{globalCounterView.count}"
				styleClass="ui-widget display" />
				
			<br/>
	
			<p:commandButton value="Click"
				actionListener="#{globalCounterView.increment}" />
		</h:form>
	
		<p:socket onMessage="handleMessage" channel="/counter"/>
	
		<script type="text/javascript">
		    function handleMessage(data) {
		        $('.display').html(data);
		    }
		</script>
	</h:body>
</html>
and web.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
       version="3.0">
	<display-name>Ubench application</display-name>

	<servlet>
		<servlet-name>Faces Servlet</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet>
        <servlet-name>Push Servlet</servlet-name>
        <servlet-class>org.primefaces.push.PushServlet</servlet-class>
		  <init-param>
    		<param-name>org.atmosphere.cpr.CometSupport.maxInactiveActivity</param-name>
    		<param-value>5400000</param-value>
	   	</init-param>
		  <init-param>
            <param-name>org.atmosphere.cpr.broadcasterCacheClass</param-name>
            <param-value>org.atmosphere.cache.UUIDBroadcasterCache</param-value>
        </init-param>      
      <load-on-startup>1</load-on-startup>
    	<async-supported>true</async-supported>
    </servlet>

	<context-param>
		<param-name>javax.faces.PROJECT_STAGE</param-name>
		<param-value>Production</param-value>
	</context-param>
	<context-param>
		<param-name>com.sun.faces.allowTextChildren</param-name>
		<param-value>true</param-value>
	</context-param>
	<context-param>
		<param-name>primefaces.THEME</param-name>
		<param-value>smoothness</param-value>
	</context-param>
	<context-param>
		<param-name>primefaces.skin</param-name>
		<param-value>smoothness</param-value>
	</context-param>
	<context-param>
		<param-name>primefaces.SUBMIT</param-name>
		<param-value>partial</param-value>
	</context-param>
	<context-param>
		<param-name>com.sun.faces.expressionFactory</param-name>
		<param-value>com.sun.el.ExpressionFactoryImpl</param-value>
	</context-param>
	<context-param>
   		<param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
    	<param-value>true</param-value>
	</context-param>

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

	<session-config>
		<session-timeout>120</session-timeout>
	</session-config>

	<welcome-file-list>
		<welcome-file>counter.xhtml</welcome-file>
	</welcome-file-list>

	<mime-mapping>
		<extension>png</extension>
		<mime-type>image/png</mime-type>
	</mime-mapping>


	<mime-mapping>
		<extension>xhtml</extension>
		<mime-type>application/xhtml+xml</mime-type>
	</mime-mapping>
</web-app>
Thanks!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 37 guests