Push samples 'counter' and 'notify' are no function

UI Components for JSF
Post Reply
sosyn
Posts: 4
Joined: 24 Apr 2015, 22:26
Location: Czech Republic

03 Jun 2015, 10:22

Hello members,
I'm newbies in PrimeFace framework and my projekt needs "push" functionality.
I'v tried test 'notify' and 'counter' from 'showcase' but 'push' don't work.

My lab local PC configuration:
  • Win7
    Java JDK 1.7.60
    GlassFish 4.1 (build 13) (server-config.network-config.protocols.protocol.http-listener-1.http.comet-support-enabled="true")
    Mojara 2.2.7
    PrimeFaces 5.2
    Atmosphere Framework 2.3.1
    NetBeans IDE 8.0.2
    I tried samples in FireFox 38.0.5 and Internet Explorer 11.0.9600
Source codes were copied from "http://www.primefaces.org/showcase/push/counter.xhtml" and "http://www.primefaces.org/showcase/push/notify.xhtml"

counter.xhtm (I tried set every kinds params in <p:socket>, I started without params like in 'showcase' )

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"     
      xmlns:h="http://xmlns.jcp.org/jsf/html">


    <head>
        <title>TODO supply a title</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <script type="text/javascript">
            function handleMessage(data) {
                alert("handleMessage");
                $('.display').html(data);
            }
        </script>    </head>
    <h:form id="form">
        <h:outputText id="out" value="#{globalCounterView.count}" styleClass="ui-widget display" />

        <p:commandButton value="Click" actionListener="#{globalCounterView.increment}" />
    </h:form>

    <p:socket channel="/counter"  
              onMessage="handleMessage" 
              onLocalMessage="alert('onLocalMessage');"
              onMessagePublished="alert('onMessagePublished');"
              id="socket" 
              autoConnect="true"  
              fallbackTransport="websocket" 
              onTransportFailure="alert('onTransportFailure');"  
              />

</html>
CounterResource.java

Code: Select all

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

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

@PushEndpoint("/counter")
public class CounterResource {
    @OnOpen
    public void onStart(){
        System.out.println("onStart");
    }
    
    @OnMessage(encoders = {JSONEncoder.class})
    public String onMessage(String count) {
        return count;
    }

    @OnClose
    public void onClose(){
        System.out.println("onClose");
    }

}
GlobalCounterView.java

Code: Select all

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

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
@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++;
     
        EventBusFactory ebf=EventBusFactory.getDefault();
        EventBus eventBus = ebf.eventBus();
        eventBus.publish("/counter", String.valueOf(count));
    }
}
Config file 'web.xml' with params which I found in 'Google'

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    
    <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>
        <init-param>
            <param-name>org.atmosphere.cpr.broadcaster.maxProcessingThreads</param-name>
            <param-value>15</param-value>
        </init-param>
        <init-param>
            <param-name>org.atmosphere.cpr.broadcaster.maxAsyncWriteThreads</param-name>
            <param-value>15</param-value>
        </init-param>
        <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>
    
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    
    <welcome-file-list>
        <welcome-file>faces/counter.xhtml</welcome-file>
    </welcome-file-list>

</web-app>
In case 'counter' (same 'notify') annotated class

Code: Select all

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

was never called.

I investigated generated HTML code and I found pieces of JavaScript

Code: Select all

"... url:"/Counter/primepush/counter ..."
When I call this URL in browser, method

Code: Select all

'@OnMessage(encoders = {JSONEncoder.class}) 
public String onMessage(String count) ...' 

was called, but no one client (FF or IE) received 'push' message (String count) and included JavaScrpit code no run.

I tried set parameters 'autoConnect=true' and every value from 'fallbackTransport=...' in '<p:socket>', but still nothing.
Showcase from 'http://www.primefaces.org/showcase/push/counter.xhtml' goes OK.
I downloaded 'atmosphere-chat-2.3.1.war' and deployed it and everything goes OK.
I downloaded 'showcase-5.2.war' and deployed it and everything goes OK.
I tried use 'web.xml' from this 'showcase-5.2.war' in my project 'counter', but still nothing.
I tried deploy my 'counter.war' direct to GlassFish server outside NetBeans IDE and still nothing.

Can anybody take me advise, how configure 'push' ?

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

06 Jun 2015, 03:57

read this from start to finish and try the code/config posted there.
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

sosyn
Posts: 4
Joined: 24 Apr 2015, 22:26
Location: Czech Republic

08 Jun 2015, 11:20

Thank you for your advice.
When I started my sample project I red this post (because it was founded by Google), but this issue is not successfully closed yet.
I tried configure 'web.xml' like in 'ClaudioC' post (I haven't problem with CDI, I use clear code from showcase, or EventBusFactory.getDefault()=null value).
My problem is in fact, that code 'CounterResource.java' is never called ( only in situation, when I call direct 'http://Counter/primepush/counter' from client), but pushing message didn't come to client in every case.

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

08 Jun 2015, 15:18

sosyn wrote:My problem is in fact, that code 'CounterResource.java' is never called ...
Really? interesting.

I copy/pasted your code below. Where is the (Primefaces Push) @Singleton annotation?

Code: Select all

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

@PushEndpoint("/counter")
public class CounterResource {
Here is mine, below...

Code: Select all

import org.primefaces.push.annotation.PushEndpoint;
import org.primefaces.push.annotation.Singleton;
 
@PushEndpoint("/{...}")
@Singleton
public class NotifyResource {
Oh wow, I checked showcase code on (svn/code.google.com), and Notify and Counter Resource classes do not reference @Singleton annotation. ChatResource (svn) references @Singleton annotation.
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

sosyn
Posts: 4
Joined: 24 Apr 2015, 22:26
Location: Czech Republic

08 Jun 2015, 16:38

Thank You,
I'v added annotation '@Singleton' to

CounterResource.java

Code: Select all


import org.primefaces.push.annotation.OnClose;
import org.primefaces.push.annotation.OnMessage;
import org.primefaces.push.annotation.OnOpen;
import org.primefaces.push.annotation.PushEndpoint;
import org.primefaces.push.annotation.Singleton;
import org.primefaces.push.impl.JSONEncoder;

@PushEndpoint("/counter")
@Singleton
public class CounterResource {
    @OnOpen
    public void onStart(){
        // Only for debug
        System.out.println("onStart");
    }
    
    @OnMessage(encoders = {JSONEncoder.class})
    public String onMessage(String count) {
        return count;
    }

    @OnClose
    public void onClose(){
        // Only for debug
        System.out.println("onClose");
    }
}
but still no one methods was called.

I tried it in one window (2 view) in FF (also IE), in window FF and window IE

I included code from GlassFish4.1 log, where are records about initialization '@PushEndpoint' (on the bottom) :

Code: Select all

...
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.gf.cdi.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.gf.cdi.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Info:   WebModule[null] ServletContext.log():Initializing AtmosphereFramework
Info:   Registering WebSocket filter for url pattern /*
Info:   Initializing Mojarra 2.2.7 ( 20140610-1547 https://svn.java.net/svn/mojarra~svn/tags/2.2.7@13362) for context '/Counter'
Info:   Running on PrimeFaces 5.2
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Atmosphere is using org.atmosphere.cpr.DefaultAnnotationProcessor for processing annotation
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.DefaultAnnotationProcessor - AnnotationProcessor class org.atmosphere.cpr.DefaultAnnotationProcessor$ServletContainerInitializerAnnotationProcessor being used
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AnnotationHandler - Found Annotation in class org.primefaces.push.impl.PushEndpointMapper being scanned: interface org.atmosphere.config.service.EndpointMapperService
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AnnotationHandler - Found Annotation in class org.primefaces.push.impl.PushEndpointProcessor being scanned: interface org.atmosphere.config.AtmosphereAnnotation
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AnnotationHandler - Found Annotation in class org.primefaces.push.impl.PushEndpointInterceptor being scanned: interface org.atmosphere.config.service.AtmosphereInterceptorService
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AnnotationHandler - Found Annotation in class CounterResource being scanned: interface org.primefaces.push.annotation.PushEndpoint
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy mapped to context-path /counter and Broadcaster Class org.atmosphere.cpr.DefaultBroadcaster
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor [@PushEndpoint Interceptor] mapped to AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Auto detecting WebSocketHandler in /WEB-INF/classes/
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installing Default AtmosphereInterceptors
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.CorsInterceptor : CORS Interceptor Support
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.CacheHeadersInterceptor : Default Response's Headers Interceptor
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.PaddingAtmosphereInterceptor : Browser Padding Interceptor Support
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.AndroidAtmosphereInterceptor : Android Interceptor Support
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.HeartbeatInterceptor : Heartbeat Interceptor Support
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.SSEAtmosphereInterceptor : SSE Interceptor Support
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.JSONPAtmosphereInterceptor : JSONP Interceptor Support
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.JavaScriptProtocol : Atmosphere JavaScript Protocol
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor : org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.OnDisconnectInterceptor : Browser disconnection detection
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.IdleResourceInterceptor : org.atmosphere.interceptor.IdleResourceInterceptor
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Set org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults to disable them.
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Atmosphere LifeCycle with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor  Track Message Size Interceptor using | with priority BEFORE_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor CORS Interceptor Support with priority FIRST_BEFORE_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Default Response's Headers Interceptor with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Browser Padding Interceptor Support with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Android Interceptor Support with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.interceptor.HeartbeatInterceptor - HeartbeatInterceptor configured with padding value 'X', client frequency 60 seconds and server frequency 0 seconds
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Heartbeat Interceptor Support with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor SSE Interceptor Support with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor JSONP Interceptor Support with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Atmosphere JavaScript Protocol with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Browser disconnection detection with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor org.atmosphere.interceptor.IdleResourceInterceptor with priority BEFORE_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Using EndpointMapper class org.primefaces.push.impl.PushEndpointMapper
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Using BroadcasterCache: org.atmosphere.cache.UUIDBroadcasterCache
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Default Broadcaster Class: org.atmosphere.cpr.DefaultBroadcaster
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Broadcaster Shared List Resources: false
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Broadcaster Polling Wait Time 100
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Shared ExecutorService supported: true
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Messaging Thread Pool Size: 15
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Async I/O Thread Pool Size: 15
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Using BroadcasterFactory: org.atmosphere.cpr.DefaultBroadcasterFactory
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Using AtmosphereResurceFactory: org.atmosphere.cpr.DefaultAtmosphereResourceFactory
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Using WebSocketProcessor: org.atmosphere.websocket.DefaultWebSocketProcessor
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Invoke AtmosphereInterceptor on WebSocket message true
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - HttpSession supported: false
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Atmosphere is using org.atmosphere.inject.InjectableObjectFactory for dependency injection and object creation
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Atmosphere is using async support: org.atmosphere.container.GlassFishServ30WebSocketSupport running under container: GlassFish Server Open Source Edition  4.1  with WebSocket enabled.
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Atmosphere Framework 2.3.1 started.
Severe:   [admin-listener(2)] 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
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor @PushEndpoint Interceptor with priority AFTER_DEFAULT
Info:   Loading application [Counter] at [/Counter]
Info:   Counter was successfully deployed in 3 539 milliseconds.
Severe:   [Thread-36] INFO org.atmosphere.cpr.AtmosphereFramework - Latest version of Atmosphere's JavaScript Client 2.2.11

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

08 Jun 2015, 17:25

sosyn wrote:I included code from GlassFish4.1 log, where are records about initialization '@PushEndpoint' (on the bottom) :

Code: Select all

...
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.gf.cdi.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.gf.cdi.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARN:   WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Info:   WebModule[null] ServletContext.log():Initializing AtmosphereFramework
Info:   Registering WebSocket filter for url pattern /*
Info:   Initializing Mojarra 2.2.7 ( 20140610-1547 https://svn.java.net/svn/mojarra~svn/tags/2.2.7@13362) for context '/Counter'
Info:   Running on PrimeFaces 5.2
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Atmosphere is using org.atmosphere.cpr.DefaultAnnotationProcessor for processing annotation
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.DefaultAnnotationProcessor - AnnotationProcessor class org.atmosphere.cpr.DefaultAnnotationProcessor$ServletContainerInitializerAnnotationProcessor being used
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AnnotationHandler - Found Annotation in class org.primefaces.push.impl.PushEndpointMapper being scanned: interface org.atmosphere.config.service.EndpointMapperService
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AnnotationHandler - Found Annotation in class org.primefaces.push.impl.PushEndpointProcessor being scanned: interface org.atmosphere.config.AtmosphereAnnotation
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AnnotationHandler - Found Annotation in class org.primefaces.push.impl.PushEndpointInterceptor being scanned: interface org.atmosphere.config.service.AtmosphereInterceptorService
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AnnotationHandler - Found Annotation in class CounterResource being scanned: interface org.primefaces.push.annotation.PushEndpoint
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy mapped to context-path /counter and Broadcaster Class org.atmosphere.cpr.DefaultBroadcaster
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor [@PushEndpoint Interceptor] mapped to AtmosphereHandler org.primefaces.push.impl.PushEndpointHandlerProxy
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Auto detecting WebSocketHandler in /WEB-INF/classes/
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installing Default AtmosphereInterceptors
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.CorsInterceptor : CORS Interceptor Support
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.CacheHeadersInterceptor : Default Response's Headers Interceptor
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.PaddingAtmosphereInterceptor : Browser Padding Interceptor Support
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.AndroidAtmosphereInterceptor : Android Interceptor Support
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.HeartbeatInterceptor : Heartbeat Interceptor Support
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.SSEAtmosphereInterceptor : SSE Interceptor Support
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.JSONPAtmosphereInterceptor : JSONP Interceptor Support
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.JavaScriptProtocol : Atmosphere JavaScript Protocol
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor : org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.OnDisconnectInterceptor : Browser disconnection detection
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.IdleResourceInterceptor : org.atmosphere.interceptor.IdleResourceInterceptor
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Set org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults to disable them.
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Atmosphere LifeCycle with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor  Track Message Size Interceptor using | with priority BEFORE_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor CORS Interceptor Support with priority FIRST_BEFORE_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Default Response's Headers Interceptor with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Browser Padding Interceptor Support with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Android Interceptor Support with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.interceptor.HeartbeatInterceptor - HeartbeatInterceptor configured with padding value 'X', client frequency 60 seconds and server frequency 0 seconds
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Heartbeat Interceptor Support with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor SSE Interceptor Support with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor JSONP Interceptor Support with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Atmosphere JavaScript Protocol with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor Browser disconnection detection with priority AFTER_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor org.atmosphere.interceptor.IdleResourceInterceptor with priority BEFORE_DEFAULT
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Using EndpointMapper class org.primefaces.push.impl.PushEndpointMapper
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Using BroadcasterCache: org.atmosphere.cache.UUIDBroadcasterCache
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Default Broadcaster Class: org.atmosphere.cpr.DefaultBroadcaster
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Broadcaster Shared List Resources: false
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Broadcaster Polling Wait Time 100
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Shared ExecutorService supported: true
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Messaging Thread Pool Size: 15
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Async I/O Thread Pool Size: 15
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Using BroadcasterFactory: org.atmosphere.cpr.DefaultBroadcasterFactory
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Using AtmosphereResurceFactory: org.atmosphere.cpr.DefaultAtmosphereResourceFactory
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Using WebSocketProcessor: org.atmosphere.websocket.DefaultWebSocketProcessor
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Invoke AtmosphereInterceptor on WebSocket message true
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - HttpSession supported: false
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Atmosphere is using org.atmosphere.inject.InjectableObjectFactory for dependency injection and object creation
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Atmosphere is using async support: org.atmosphere.container.GlassFishServ30WebSocketSupport running under container: GlassFish Server Open Source Edition  4.1  with WebSocket enabled.
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Atmosphere Framework 2.3.1 started.
Severe:   [admin-listener(2)] 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
Severe:   [admin-listener(2)] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor @PushEndpoint Interceptor with priority AFTER_DEFAULT
Info:   Loading application [Counter] at [/Counter]
Info:   Counter was successfully deployed in 3 539 milliseconds.
Severe:   [Thread-36] INFO org.atmosphere.cpr.AtmosphereFramework - Latest version of Atmosphere's JavaScript Client 2.2.11
Okay. Those Glassfish/WELD WARNING messages about @Observes and CDI are interesting at startup. I recognized that @PushEndpoint is initialized at startup in my app, too.

You may have better success by searching or posting your question on the atmosphere framework google groups mail list.

I searched the mail list for glassfish pushendpoint and found the following:

PushServlet and and JavaEE websockets

Primefaces 5.0 and Push/Grizzly Error

Please read those from start to finish.
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

sosyn
Posts: 4
Joined: 24 Apr 2015, 22:26
Location: Czech Republic

26 Jun 2015, 15:06

Thank You members for your help and your time,
after 2 months (atmosphere study, jquery.js study, primefaces.js study, web browser debug ) I found my own BUG in my code.
I used HTML syntax for node "<head>" instead JSF syntax "<h:head>" and Primefaces didn't add necessary JavaScript libraries.

So, I am still beginner.

Component "Socket" (for PUSH services) from PrimeFaces 5.2 is fully functional in GF4.1, JSF 2.2 in browsers IE11, FF38

Add: "Atmosphere" is very interesting SW.

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

26 Jun 2015, 15:14

Great! Thanks for letting us know!
sosyn wrote:Add: "Atmosphere" is very interesting SW.
Are you being sarcastic? :D
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

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 33 guests