[Solved] PrimePush 4 with Tomcat 7.0.53 throws exception

UI Components for JSF
potter.cu
Posts: 40
Joined: 15 Jul 2011, 20:02
Contact:

14 Apr 2014, 18:07

Hi:

I'm using PrimePush with Atmosphere 2.0.8 in an application. I have a p:socket that works fine when I use websocket transport is but if I put long-polling or other transport the push fails. However I test the application apparently works well on Jetty but I need to use Tomcat and long-polling for older browsers.

Here is the stacktrace:

Code: Select all

Apr 14, 2014 11:22:18 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Push Servlet] in context with path [/myApp] threw exception
java.lang.IllegalStateException: Not supported.
	at org.apache.catalina.connector.Request.startAsync(Request.java:1658)
	at org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1029)
	at javax.servlet.ServletRequestWrapper.startAsync(ServletRequestWrapper.java:379)
	at javax.servlet.ServletRequestWrapper.startAsync(ServletRequestWrapper.java:379)
	at org.atmosphere.cpr.AtmosphereRequest.startAsync(AtmosphereRequest.java:678)
	at org.atmosphere.container.Servlet30CometSupport.suspend(Servlet30CometSupport.java:93)
	at org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:68)
	at org.atmosphere.container.Tomcat7Servlet30SupportWithWebSocket.doService(Tomcat7Servlet30SupportWithWebSocket.java:67)
	at org.atmosphere.container.TomcatWebSocketUtil.doService(TomcatWebSocketUtil.java:98)
	at org.atmosphere.container.Tomcat7Servlet30SupportWithWebSocket.service(Tomcat7Servlet30SupportWithWebSocket.java:62)
	at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1790)
	at org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:201)
	at org.atmosphere.cpr.AtmosphereServlet.doGet(AtmosphereServlet.java:187)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:64)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:146)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:98)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1721)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1679)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:722)
Here is the web.xml configuration:

Code: Select all

<!-- PrimeFaces Configuration -->
<servlet>
<servlet-name>Push Servlet</servlet-name>
	<servlet-class>org.primefaces.push.PushServlet</servlet-class>
	<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>
Here is the socket:

Code: Select all

<p:socket channel="/logo" onMessage="updateLogo" transport="long-polling" />
Here is the connector in Tomcat:

Code: Select all

<Connector connectionTimeout="20000" port="8081" protocol="org.apache.coyote.http11.Http11NioProtocol" redirectPort="8443"/>
My skill with atmosphere are not the best so I need some help.

Thanks in advance
Last edited by potter.cu on 17 Apr 2014, 00:30, edited 1 time in total.
PrimeFaces 5.1 | PrimeFaces Extensions 3.0.0 | JSF Mojarra 2.2.8 | Apache Tomcat 7.0.53 | Jetty 8.1.3 | Mozilla Firefox 33 | Google Chrome 38 | Internet Explorer 11

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

14 Apr 2014, 23:55

potter.cu wrote:I'm using PrimePush with Atmosphere 2.0.8 in an application. I have a p:socket that works fine when I use websocket transport is but if I put long-polling or other transport the push fails.
Atmosphere 2.1.1

try that, and let us know if it fixes your issue, please.
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

potter.cu
Posts: 40
Joined: 15 Jul 2011, 20:02
Contact:

15 Apr 2014, 21:48

Sorry, I forgot to mention that I tried Atmosphere 2.0.2, 2.0.8, 2.1.0 and 2.1.1 all with the same result
PrimeFaces 5.1 | PrimeFaces Extensions 3.0.0 | JSF Mojarra 2.2.8 | Apache Tomcat 7.0.53 | Jetty 8.1.3 | Mozilla Firefox 33 | Google Chrome 38 | Internet Explorer 11

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

15 Apr 2014, 22:18

okay. I just searched atmosphere framework's google groups mail list for

tomcat long polling

and found some search results. Can you read through those, and let us know your findings or solution here? you 'may' need to post a mail on that mail list. again, let us know your solution/workaround. thanks.
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

potter.cu
Posts: 40
Joined: 15 Jul 2011, 20:02
Contact:

17 Apr 2014, 00:29

After a lot of search and a little bit of lucky I found this:

http://atmosphere-framework.2306103.n4. ... 57564.html
https://groups.google.com/forum/#!topic ... Be21qt5lkI

So my servlet config:

Code: Select all

<!-- PrimeFaces Configuration -->
<servlet>
	<servlet-name>Push Servlet</servlet-name>
	<servlet-class>org.primefaces.push.PushServlet</servlet-class>
		
	<init-param>
		<param-name>org.atmosphere.useNative</param-name>
		<param-value>true</param-value>
	</init-param>
	<init-param>
		<param-name>org.atmosphere.cpr.sessionSupport</param-name>
		<param-value>true</param-value>
	</init-param>
	<init-param>
        	<param-name>org.atmosphere.cpr.broadcasterCacheClass</param-name>
        	<param-value>org.atmosphere.cache.HeaderBroadcasterCache</param-value>
        </init-param>
        <init-param>
        	<param-name>org.atmosphere.cpr.broadcasterClass</param-name>
        	<param-value>org.atmosphere.cpr.DefaultBroadcaster</param-value>
        </init-param>
        <init-param>
        	<param-name>org.atmosphere.cpr.CometSupport.maxInactiveActivity</param-name>
        	<param-value>1800000</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>
I think PrimePush need a more extensive documentation and Atmosphere too. I know that use Atmosphere is not easy but with more in deep tutorials the users can do more things with less difficulty.

A couple of year ago I had to use Atmosphere with jQuery plugin and JMS integration because PrimePush didn't had PushContext like now and it used RequestContext so I was unable to send push messages directly from the server and I know want to use PrimePush easily... so I'm now waiting for PrimeFaces 5 and PrimePush 2

Thanks for the tips.
PrimeFaces 5.1 | PrimeFaces Extensions 3.0.0 | JSF Mojarra 2.2.8 | Apache Tomcat 7.0.53 | Jetty 8.1.3 | Mozilla Firefox 33 | Google Chrome 38 | Internet Explorer 11

jfarcand
Posts: 19
Joined: 02 Feb 2010, 20:23

17 Apr 2014, 11:43

The answer to the question here is you must enable Servlet 3.0 Async Behavior (that has nothing to do with Atmosphere :-))

Code: Select all

<async-supported>true</async-supported>
(all the remaining web.xml stuff is not needed)

I will make sure this is better documented in PrimeFaces 5.

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

17 Apr 2014, 13:58

+1 thanks Jeanfrancois!
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

potter.cu
Posts: 40
Joined: 15 Jul 2011, 20:02
Contact:

17 Apr 2014, 16:33

The first thing I do was to enable Servlet 3.0 Async behavior but it doesn't work, however when I put the rest of the settings in the web.xml it worked.

This was my original web.xml servlet configuration:

Code: Select all

<!-- PrimeFaces Configuration -->
<servlet>
<servlet-name>Push Servlet</servlet-name>
   <servlet-class>org.primefaces.push.PushServlet</servlet-class>
   <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>
PrimeFaces 5.1 | PrimeFaces Extensions 3.0.0 | JSF Mojarra 2.2.8 | Apache Tomcat 7.0.53 | Jetty 8.1.3 | Mozilla Firefox 33 | Google Chrome 38 | Internet Explorer 11

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

17 Apr 2014, 18:42

hmmm, ...
potter.cu wrote:The first thing I do was to enable Servlet 3.0 Async behavior but it doesn't work, however when I put the rest of the settings in the web.xml it worked.
okay, and..
potter.cu wrote:This was my original web.xml servlet configuration:

Code: Select all

<!-- PrimeFaces Configuration -->
<servlet>
<servlet-name>Push Servlet</servlet-name>
   <servlet-class>org.primefaces.push.PushServlet</servlet-class>
   <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>
this is how your web.xml looks now + servlet 3.0 specified in web.xml?
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

potter.cu
Posts: 40
Joined: 15 Jul 2011, 20:02
Contact:

17 Apr 2014, 19:03

Nop, my PrimePush Servlet config looks like this:

Code: Select all

   <!-- PrimeFaces Configuration -->
	<servlet>
		<servlet-name>Push Servlet</servlet-name>
		<servlet-class>org.primefaces.push.PushServlet</servlet-class>

		<init-param>
			<param-name>org.atmosphere.useNative</param-name>
			<param-value>true</param-value>
		</init-param>
		<init-param>
			<param-name>org.atmosphere.cpr.sessionSupport</param-name>
			<param-value>true</param-value>
		</init-param>
		<init-param>
			<param-name>org.atmosphere.cpr.broadcasterCacheClass</param-name>
			<param-value>org.atmosphere.cache.HeaderBroadcasterCache</param-value>
		</init-param>
		<init-param>
			<param-name>org.atmosphere.cpr.broadcasterClass</param-name>
			<param-value>org.atmosphere.cpr.DefaultBroadcaster</param-value>
		</init-param>
		<init-param>
			<param-name>org.atmosphere.cpr.CometSupport.maxInactiveActivity</param-name>
			<param-value>1800000</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>
PrimeFaces 5.1 | PrimeFaces Extensions 3.0.0 | JSF Mojarra 2.2.8 | Apache Tomcat 7.0.53 | Jetty 8.1.3 | Mozilla Firefox 33 | Google Chrome 38 | Internet Explorer 11

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 27 guests