PF 5.0RC1 Failed invoking AtmosphereFramework.doCometSupport

UI Components for JSF
magsam
Posts: 71
Joined: 18 Jun 2012, 17:43
Location: Bavaria, DE
Contact:

21 Apr 2014, 12:58

I tested atmosphere with the counterexample . I get this bug - the Comet Support ist enabled

Code: Select all

2014-04-21T12:46:40.264+0200|Schwerwiegend: [Thread-51] INFO org.atmosphere.cpr.AtmosphereFramework - Latest version of Atmosphere's JavaScript Client 2.1.5
2014-04-21T12:46:40.671+0200|Warnung: DefaultCacheProvider is for development purposes only, prefer another provider such as EhCache and HazelCast in production.
2014-04-21T12:46:41.901+0200|Schwerwiegend: [http-listener-1(5)] WARN org.atmosphere.websocket.DefaultWebSocketProcessor - Failed invoking AtmosphereFramework.doCometSupport()
2014-04-21T12:46:41.903+0200|Schwerwiegend: java.lang.NullPointerException
	at org.glassfish.grizzly.http.io.InputBuffer.read(InputBuffer.java:327)
	at org.glassfish.grizzly.http.server.NIOInputStreamImpl.read(NIOInputStreamImpl.java:83)
	at org.glassfish.grizzly.servlet.ServletInputStreamImpl.read(ServletInputStreamImpl.java:129)
	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
	at java.io.InputStreamReader.read(InputStreamReader.java:184)
	at java.io.BufferedReader.read1(BufferedReader.java:203)
	at java.io.BufferedReader.read(BufferedReader.java:279)
	at java.io.Reader.read(Reader.java:140)
	at org.atmosphere.util.IOUtils.readEntirely(IOUtils.java:77)
	at org.primefaces.push.impl.PushEndpointHandlerProxy.onRequest(PushEndpointHandlerProxy.java:150)
	at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:174)
	at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:95)
	at org.atmosphere.container.GlassFishServ30WebSocketSupport.service(GlassFishServ30WebSocketSupport.java:60)
	at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1805)
	at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:432)
	at org.atmosphere.websocket.DefaultWebSocketProcessor.open(DefaultWebSocketProcessor.java:186)
	at org.atmosphere.container.GlassFishServ30WebSocketSupport$Grizzly2WebSocketApplication.onConnect(GlassFishServ30WebSocketSupport.java:144)
	at org.glassfish.grizzly.websockets.DefaultWebSocket.onConnect(DefaultWebSocket.java:202)
	at org.glassfish.grizzly.websockets.WebSocketEngine.upgrade(WebSocketEngine.java:229)
	at org.glassfish.grizzly.extras.addons.WebSocketAddOnProvider$GlassfishWebSocketFilter.doServerUpgrade(WebSocketAddOnProvider.java:118)
	at org.glassfish.grizzly.websockets.WebSocketFilter.handleServerHandshake(WebSocketFilter.java:319)
	at org.glassfish.grizzly.websockets.WebSocketFilter.handleHandshake(WebSocketFilter.java:278)
	at org.glassfish.grizzly.websockets.WebSocketFilter.handleRead(WebSocketFilter.java:199)
	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
	at java.lang.Thread.run(Thread.java:744)
2014-04-21T12:46:41.904+0200|Schwerwiegend: [http-listener-1(5)] WARN org.atmosphere.websocket.protocol.SimpleHttpProtocol - java.lang.NullPointerException Status 500 Message Server Error
PrimeFaces 6.1, Extensions 6.1.1 , Mojarra 2.3 , GlassFish Server Open Source Edition 4.1 (build 13) , atmosphere-runtime 2.4.9 , Open Source ERP with Primefaces http://osretail.de/osRetail/

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

21 Apr 2014, 17:27

please share your entire web.xml and PrimeFaces Push xhtml and bean code.
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

magsam
Posts: 71
Joined: 18 Jun 2012, 17:43
Location: Bavaria, DE
Contact:

21 Apr 2014, 18:42

the web.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
	id="WebApp_ID" version="3.0">
	<display-name>osRetail</display-name>
	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>
	<context-param>
		<param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
		<param-value>true</param-value>
	</context-param>
	<context-param>
		<param-name>com.sun.faces.forceLoadConfiguration</param-name>
		<param-value>true</param-value>
	</context-param>
	<context-param>
		<param-name>InjectionProvider</param-name>
		<param-value>de.osretail.basis.InjectionProvider</param-value>
	</context-param>
	<context-param>
		<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
		<param-value>server</param-value>
	</context-param>
	<context-param>
		<param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
		<param-value>true</param-value>
	</context-param>
	<context-param>
		<param-name>javax.faces.PROJECT_STAGE</param-name>
		<param-value>Production</param-value>
	</context-param>
	<context-param>
		<param-name>primefaces.TRANSFORM_METADATA</param-name>
		<param-value>true</param-value>
	</context-param>

	<listener>
		<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
	</listener>


	<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>1</load-on-startup>
		<async-supported>true</async-supported>
	</servlet>
	<servlet-mapping>
		<servlet-name>Push Servlet</servlet-name>
		<url-pattern>/primepush/*</url-pattern>
	</servlet-mapping>

	<context-param>
		<param-name>primefaces.THEME</param-name>
		<param-value>#{guestPreferences.theme}</param-value>
	</context-param>
	<servlet>
		<description>Downloader for Designer</description>
		<display-name>downloader</display-name>
		<servlet-name>downloader</servlet-name>
		<jsp-file>/download.jsp</jsp-file>
	</servlet>
	<servlet-mapping>
		<servlet-name>downloader</servlet-name>
		<url-pattern>/downloader</url-pattern>
	</servlet-mapping>
	<filter>
		<filter-name>PrimeFaces FileUpload Filter</filter-name>
		<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
		<init-param>
			<param-name>thresholdSize</param-name>
			<param-value>2040</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>PrimeFaces FileUpload Filter</filter-name>
		<servlet-name>Faces Servlet</servlet-name>
	</filter-mapping>
	<context-param>
		<param-name>primefaces.UPLOADER</param-name>
		<param-value>auto</param-value>
	</context-param>

	<error-page>
		<exception-type>javax.faces.application.ViewExpiredException</exception-type>
		<location>/faces/exception/expiredSession.xhtml</location>
	</error-page>
	<error-page>
		<exception-type>javax.servlet.ServletException</exception-type>
		<location>/faces/exception/servletException.xhtml</location>
	</error-page>

	<error-page>
		<exception-type>de.osretail.exception.LogonException</exception-type>
		<location>/faces/exception/expiredSession.xhtml</location>
	</error-page>
</web-app>
the xhtml

Code: Select all

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

	<!-- HIER WIRD DER CONTENT DER SEITE EINGESETZT -->
	<ui:define name="content" style="margin-right: auto; margin-left: 1%;">
			<script type="text/javascript">
				function handleMessage(data) {
					$('.display').html(data);
				}
			</script>

			<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 onMessage="handleMessage" channel="/counter" />

			<h:outputText id="out" value="#{globalCounterBean.count}"
				styleClass="ui-widget display" />
					</ui:define>
</ui:composition>
and the beans

Code: Select all

package de.osretail.basis;

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;
   }
} 


package de.osretail.basis;

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++;
         
        EventBus eventBus = EventBusFactory.getDefault().eventBus();
        eventBus.publish("/counter", String.valueOf(count));
    }
}
PrimeFaces 6.1, Extensions 6.1.1 , Mojarra 2.3 , GlassFish Server Open Source Edition 4.1 (build 13) , atmosphere-runtime 2.4.9 , Open Source ERP with Primefaces http://osretail.de/osRetail/

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

21 Apr 2014, 19:15

magsam wrote:I tested atmosphere with the counterexample . I get this bug - the Comet Support ist enabled

Code: Select all

2014-04-21T12:46:40.264+0200|Schwerwiegend: [Thread-51] INFO org.atmosphere.cpr.AtmosphereFramework - Latest version of Atmosphere's JavaScript Client 2.1.5
2014-04-21T12:46:40.671+0200|Warnung: DefaultCacheProvider is for development purposes only, prefer another provider such as EhCache and HazelCast in production.
2014-04-21T12:46:41.901+0200|Schwerwiegend: [http-listener-1(5)] WARN org.atmosphere.websocket.DefaultWebSocketProcessor - Failed invoking AtmosphereFramework.doCometSupport()
2014-04-21T12:46:41.903+0200|Schwerwiegend: java.lang.NullPointerException
	at org.glassfish.grizzly.http.io.InputBuffer.read(InputBuffer.java:327)
	at org.glassfish.grizzly.http.server.NIOInputStreamImpl.read(NIOInputStreamImpl.java:83)
	at org.glassfish.grizzly.servlet.ServletInputStreamImpl.read(ServletInputStreamImpl.java:129)

...

2014-04-21T12:46:41.904+0200|Schwerwiegend: [http-listener-1(5)] WARN org.atmosphere.websocket.protocol.SimpleHttpProtocol - java.lang.NullPointerException Status 500 Message Server Error
did you enable comet support in Glassfish 4.0?

did PrimeFaces Push work for you when using PrimeFaces 4.0(.x) and Glassfish 4.0.x?
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

magsam
Posts: 71
Joined: 18 Jun 2012, 17:43
Location: Bavaria, DE
Contact:

21 Apr 2014, 22:34

Yes comet support is enabled
Yes it worked with PF 4.0 and glassfish 4.0
PrimeFaces 6.1, Extensions 6.1.1 , Mojarra 2.3 , GlassFish Server Open Source Edition 4.1 (build 13) , atmosphere-runtime 2.4.9 , Open Source ERP with Primefaces http://osretail.de/osRetail/

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

21 Apr 2014, 23:34

which browser are you using? earlier version of Internet explorer? IE6/7/8 ?

hmmm, i wonder if your browser does not support websocket, but downgrades to comet.
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

magsam
Posts: 71
Joined: 18 Jun 2012, 17:43
Location: Bavaria, DE
Contact:

22 Apr 2014, 17:30

Hi Howard,

I use the newst version of: IE, firefox , chrome, safari opera and maxthon
PrimeFaces 6.1, Extensions 6.1.1 , Mojarra 2.3 , GlassFish Server Open Source Edition 4.1 (build 13) , atmosphere-runtime 2.4.9 , Open Source ERP with Primefaces http://osretail.de/osRetail/

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

22 Apr 2014, 17:59

magsam wrote:I use the newst version of: IE, firefox , chrome, safari opera and maxthon
you see this error when you test on all of these browsers?
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

magsam
Posts: 71
Joined: 18 Jun 2012, 17:43
Location: Bavaria, DE
Contact:

22 Apr 2014, 19:47

yes I tested each browser
PrimeFaces 6.1, Extensions 6.1.1 , Mojarra 2.3 , GlassFish Server Open Source Edition 4.1 (build 13) , atmosphere-runtime 2.4.9 , Open Source ERP with Primefaces http://osretail.de/osRetail/

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

22 Apr 2014, 20:05

magsam wrote:yes I tested each browser
interesting. okay, I pinged Jeanfrancois. hopefully, he will have time to respond to this post of yours.
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: Mordets and 44 guests