PF 4 to 5 migration: "No Broadcaster matches..."

UI Components for JSF
Post Reply
FkJ
Posts: 183
Joined: 08 Jan 2010, 19:16

27 Jun 2014, 21:02

From what I know, the old push API is now deprecated, but still supported for backward compatibility.

After migration from PF 4.0.15 to 5.0.2 I keep getting a "No broadcaster matches" error.

I copied the notify example from the showcase to check if it would work with the new API, but the problem still happens:

Code: Select all

[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Atmosphere is using org.atmosphere.cpr.DefaultAnnotationProcessor for processing annotation
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.DefaultAnnotationProcessor - AnnotationProcessor class org.atmosphere.cpr.DefaultAnnotationProcessor$BytecodeBasedAnnotationProcessor being used
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.DefaultAnnotationProcessor - Found Annotation in org.primefaces.push.impl.PushEndpointInterceptor being scanned: interface org.atmosphere.config.service.AtmosphereInterceptorService
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.DefaultAnnotationProcessor - Found Annotation in org.primefaces.push.impl.PushEndpointMapper being scanned: interface org.atmosphere.config.service.EndpointMapperService
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Auto detecting atmosphere handlers /WEB-INF/classes/
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Auto detecting WebSocketHandler in /WEB-INF/classes/
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol 
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Installing Default AtmosphereInterceptor
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.CorsInterceptor : CORS Interceptor Support
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.CacheHeadersInterceptor : Default Response's Headers Interceptor
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.PaddingAtmosphereInterceptor : Browser Padding Interceptor Support
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.AndroidAtmosphereInterceptor : Android Interceptor Support
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.HeartbeatInterceptor : Heartbeat Interceptor Support
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.SSEAtmosphereInterceptor : SSE Interceptor Support
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.JSONPAtmosphereInterceptor : JSONP Interceptor Support
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.JavaScriptProtocol : Atmosphere JavaScript Protocol
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor : org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.OnDisconnectInterceptor : Browser disconnection detection
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - 	org.atmosphere.interceptor.IdleResourceInterceptor : org.atmosphere.interceptor.IdleResourceInterceptor
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Set org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults to disable them.
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Using EndpointMapper class org.primefaces.push.impl.PushEndpointMapper
[http-nio-8080-exec-3] WARN org.atmosphere.cpr.AtmosphereFramework - No BroadcasterCache configured. Broadcasted message between client reconnection will be LOST. It is recommended to configure the org.atmosphere.cache.UUIDBroadcasterCache
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Default Broadcaster Class: org.atmosphere.cpr.DefaultBroadcaster
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Broadcaster Polling Wait Time 100
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Shared ExecutorService supported: true
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Messaging Thread Pool Size: Unlimited
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Async I/O Thread Pool Size: 200
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Using BroadcasterFactory: org.atmosphere.cpr.DefaultBroadcasterFactory
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Using WebSocketProcessor: org.atmosphere.websocket.DefaultWebSocketProcessor
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - HttpSession supported: true
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Atmosphere is using DefaultAtmosphereObjectFactory for dependency injection and object creation
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Atmosphere is using async support: org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket running under container: Apache Tomcat/7.0.52
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Atmosphere Framework 2.1.6 started.
[http-nio-8080-exec-3] 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

[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor @PushEndpoint Interceptor with priority AFTER_DEFAULT 
[http-nio-8080-exec-3] INFO org.atmosphere.cpr.AtmosphereServlet - AtmosphereServlet with native support for Tomcat 6/7 and JBossWeb Installed.
[Thread-9] INFO org.atmosphere.cpr.AtmosphereFramework - Latest version of Atmosphere's JavaScript Client 2.2.2
[http-nio-8080-exec-5] WARN org.atmosphere.cpr.MetaBroadcaster - No Broadcaster matches /notify. Message javax.faces.application.FacesMessage@6f0e0834 WILL BE LOST. Make sure you cache it or make sure the Broadcaster exists before.
Tested with PF 5.0.2 + Atmosphere 2.1.6 + Tomcat 7.0.52.

Any ideas?

Thanks

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

28 Jun 2014, 00:14

reply with your entire web.xml and primefaces push xhtml and java bean code in your app.
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

FkJ
Posts: 183
Joined: 08 Jan 2010, 19:16

30 Jun 2014, 15:15

web.xml:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<web-app
	version="3.0"
	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"
>
	<display-name>Área do Técnico</display-name>

	<!-- JSF -->
	<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>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
		<param-value>true</param-value>
	</context-param>

	<!-- MyFaces -->
	<!-- 
		http://myfaces.apache.org/core22/myfaces-impl/webconfig.html
		http://tandraschko.blogspot.de/2012/08/increase-your-jsf-application.html
		USE_ENCRYPTION desativado para evitar VEE quando a aplicação é reiniciada, pois a chave para criptografia é resetada 
	-->
	<context-param>
		<param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
		<param-value>false</param-value>
	</context-param>
	<context-param>
		<param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
		<param-value>false</param-value>
	</context-param>
	<context-param>
		<param-name>org.apache.myfaces.USE_ENCRYPTION</param-name>
		<param-value>false</param-value>
	</context-param>
	<context-param>
		<param-name>org.apache.myfaces.SUPPORT_JSP_AND_FACES_EL</param-name>
		<param-value>false</param-value>
	</context-param>
	<context-param>
		<param-name>org.apache.myfaces.EXPRESSION_FACTORY</param-name>
		<param-value>org.apache.el.ExpressionFactoryImpl</param-value>
	</context-param>	
	
	<!-- PrimeFaces -->
	<context-param>
		<param-name>primefaces.SUBMIT</param-name>
		<param-value>partial</param-value>
	</context-param>
	<context-param>
		<param-name>primefaces.LEGACY_WIDGET_NAMESPACE</param-name>
		<param-value>true</param-value>
	</context-param>
	<context-param>
		<param-name>primefaces.UPLOADER</param-name>
		<param-value>commons</param-value>
	</context-param>

	<!-- Application -->
	<context-param>
		<param-name>loggable</param-name>
		<param-value>true</param-value>
	</context-param>

	<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>1048576</param-value> <!-- Arquivos maiores que 1MB são armazenados em disco -->
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>PrimeFaces FileUpload Filter</filter-name>
		<servlet-name>facesServlet</servlet-name>
	</filter-mapping>

	<filter>
		<filter-name>ShiroFilter</filter-name>
		<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>ShiroFilter</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
		<dispatcher>ERROR</dispatcher>
	</filter-mapping>

	<!-- Listeners -->
	<listener>
		<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
	</listener>
	<listener>
		<listener-class>org.atmosphere.cpr.SessionSupport</listener-class>
	</listener>
	<listener>
		<listener-class>br.com.spdata.persistence.FirebirdListener</listener-class>
	</listener>
	<listener>
		<listener-class>br.com.spdata.email.JmsEmailQueueListener</listener-class>
	</listener>

	<!-- 
		Remove arquivos temporários gerados durante o upload
		http://commons.apache.org/proper/commons-fileupload/using.html 
	-->
	<listener>
		<listener-class>org.apache.commons.fileupload.servlet.FileCleanerCleanup</listener-class>
	</listener>

	<servlet>
		<servlet-name>facesServlet</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>facesServlet</servlet-name>
		<url-pattern>*.jsf</url-pattern>
	</servlet-mapping>

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

		<!-- https://github.com/Atmosphere/atmosphere/wiki/Enabling-HttpSession-Support -->
		<init-param>
			<param-name>org.atmosphere.cpr.sessionSupport</param-name>
			<param-value>true</param-value>
		</init-param>
		<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>15</session-timeout>
	</session-config>
	
	<welcome-file-list>
		<welcome-file>/index.html</welcome-file>
	</welcome-file-list>

	<error-page>
		<error-code>404</error-code>
		<location>/template/notFound.jsf</location>
	</error-page>

	<security-constraint>
		<display-name>Restrict raw XHTML Documents</display-name>
		<web-resource-collection>
			<web-resource-name>XHTML</web-resource-name>
			<url-pattern>*.xhtml</url-pattern>
		</web-resource-collection>
		<auth-constraint />
	</security-constraint>
</web-app>
pom.xml:

Code: Select all

<project
	xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
	<modelVersion>4.0.0</modelVersion>

	<name>AreaTecnico2</name>
	<artifactId>AreaTecnico2</artifactId>
	<packaging>war</packaging>

	<parent>
		<groupId>br.com.spdata</groupId>
		<artifactId>SpdataPom</artifactId>
		<version>1.0-SNAPSHOT</version>
		<relativePath>../SpdataPom</relativePath>
	</parent>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<dependencies>
		<dependency>
			<groupId>br.com.spdata</groupId>
			<artifactId>Service</artifactId>
		</dependency>

		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>${google-guava.version}</version>
		</dependency>

		<dependency>
			<groupId>commons-fileupload</groupId>
			<artifactId>commons-fileupload</artifactId>
			<version>${commons-fileupload.version}</version>
		</dependency>

		<dependency>
			<groupId>com.amazonaws</groupId>
			<artifactId>aws-java-sdk</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.myfaces.core</groupId>
			<artifactId>myfaces-impl</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.myfaces.core</groupId>
			<artifactId>myfaces-api</artifactId>
		</dependency>

		<dependency>
			<groupId>com.googlecode.gmaps4jsf</groupId>
			<artifactId>gmaps4jsf-core</artifactId>
		</dependency>

		<dependency>
			<groupId>com.google.apis</groupId>
			<artifactId>google-api-services-calendar</artifactId>
		</dependency>

		<dependency>
			<groupId>com.google.apis</groupId>
			<artifactId>google-api-services-drive</artifactId>
		</dependency>

		<dependency>
			<groupId>com.google.oauth-client</groupId>
			<artifactId>google-oauth-client-servlet</artifactId>
		</dependency>

		<dependency>
			<groupId>com.google.code.geocoder-java</groupId>
			<artifactId>geocoder-java</artifactId>
		</dependency>

		<dependency>
			<groupId>com.google.http-client</groupId>
			<artifactId>google-http-client-jackson2</artifactId>
		</dependency>

		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>joda-time</groupId>
			<artifactId>joda-time</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.shiro</groupId>
			<artifactId>shiro-web</artifactId>
		</dependency>

		<dependency>
			<groupId>org.atmosphere</groupId>
			<artifactId>atmosphere-runtime-native</artifactId>
			<version>${atmosphere.version}</version>
			<exclusions>
				<exclusion>
					<artifactId>atmosphere-compat-tomcat7</artifactId>
					<groupId>org.atmosphere</groupId>
				</exclusion>
			</exclusions>
		</dependency>
	
		<!-- JMS -->
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-client</artifactId>
			<version>${activemq.version}</version>
		</dependency>

		<dependency>
			<groupId>javax.jms</groupId>
			<artifactId>jms</artifactId>
			<version>${javax.jms.version}</version>
		</dependency>

		<dependency>
			<groupId>javax.management.j2ee</groupId>
			<artifactId>javax.management.j2ee-api</artifactId>
			<version>${javax.management.version}</version>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<version>${slf4j-simple.version}</version>
		</dependency>

		<dependency>		
			<groupId>org.primefaces</groupId>
			<artifactId>primefaces</artifactId>
			<version>${primefaces.version}</version>
		</dependency>

		<dependency>
			<groupId>org.primefaces.extensions</groupId>
			<artifactId>primefaces-extensions</artifactId>
			<version>${primefaces-extensions.version}</version>
		</dependency>

		<dependency>
			<groupId>org.jcodec</groupId>
			<artifactId>jcodec</artifactId>
			<version>${jcodec.version}</version>
		</dependency>

		<dependency>
			<groupId>xuggle</groupId>
			<artifactId>xuggle-xuggler</artifactId>
		</dependency>

		<!-- Provided -->
		<dependency>
			<groupId>com.digitalpersona</groupId>
			<artifactId>dpuareu</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.shale</groupId>
			<artifactId>shale-test</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.sanselan</groupId>
			<artifactId>sanselan</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.tomcat</groupId>
			<artifactId>tomcat-el-api</artifactId>
			<scope>provided</scope>
		</dependency>

		<!-- Test -->
		<dependency>
			<groupId>org.firebirdsql.jdbc</groupId>
			<artifactId>jaybird-jdk17</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.testng</groupId>
			<artifactId>testng</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.jboss.arquillian.graphene</groupId>
			<artifactId>graphene-webdriver</artifactId>
			<version>${version.org.jboss.arquillian.graphene}</version>
			<type>pom</type>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<finalName>colaborador</finalName>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.1.1</version>
				<configuration>
					<failOnMissingWebXml>false</failOnMissingWebXml>
				</configuration>
			</plugin>

			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<phase>package</phase>
						<configuration>
							<target>
								<copy
									file="target/${project.build.finalName}.war"
									tofile="target/${project.build.finalName}##${BUILD_ID}.war" />
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
Rest of the code is the same as the showcase: http://www.primefaces.org/showcase/push/notify.xhtml

FkJ
Posts: 183
Joined: 08 Jan 2010, 19:16

30 Jun 2014, 22:38

Replacing atmosphere-runtime-native with atmosphere-runtime it works.

Any ideas?

Thanks

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

30 Jun 2014, 23:33

FkJ wrote:Replacing atmosphere-runtime-native with atmosphere-runtime it works.

Any ideas?
very good. if it ain't broke, then don't fix it. right? :)

i don't like your use of the following (it's not necessary)

Code: Select all

<listener-class>org.atmosphere.cpr.SessionSupport</listener-class>

Code: Select all

      <!-- https://github.com/Atmosphere/atmosphere/wiki/Enabling-HttpSession-Support -->
      <init-param>
         <param-name>org.atmosphere.cpr.sessionSupport</param-name>
         <param-value>true</param-value>
      </init-param>
and you should be using UUID broadcaster; that has been recommended in this forum and in atmosphere's forum and wiki.
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

FkJ
Posts: 183
Joined: 08 Jan 2010, 19:16

01 Jul 2014, 14:19

Actually using the default atmosphere-runtime is not a solution, because it crashes my Tomcat. No idea why, and it was a hard time to figure out that the problem was atmosphere-runtime: http://forum.primefaces.org/viewtopic.php?f=3&t=35473

Do you use atmosphere-runtime-native? In that case, could you share your pom.xml and web.xml sections related to atmosphere?

I'll remove the session support and try the UUID broadcaster.

Thanks

marc_
Posts: 1
Joined: 17 Oct 2014, 10:37

17 Oct 2014, 10:48

I am facing exactly the same situation.

If i use atmosphere-runtime I have the illegalStateException on some productive environments, on the test systems it works fine.
If I switch to atmosphere-runtime-native I get the "No brodcaster matches ..." error.

Could you share if and how you fixed the problem ?

Thanks

FkJ
Posts: 183
Joined: 08 Jan 2010, 19:16

22 Oct 2014, 18:08

I was able to get rid of the illegal state exceptions by sticking to web sockets, so I only render the p:socket component if the browser supports web sockets. In case the main suspect of those illegal states exceptions were old IE.

Getting rid of the illegal state exceptions and as I don't need Comet support now I'm able to use atmosphere-runtime without problems.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests