Push Chat. Error:NoAtmosphereHandler

UI Components for JSF
Post Reply
User avatar
thomasneu92
Posts: 1
Joined: 30 May 2014, 19:41

30 May 2014, 20:09

Im developing a Chat-Application very simular to the PrimefacesPushChat http://www.primefaces.org/showcase/push/chat.xhtml on Jboss 7 .1.
When i send a Message with the eventBus i get a Error
No AtmosphereHandler found. Make sure you define it inside WEB-INF/atmosphere.xml or annotate using @___Service
:cry: :x .
Are any dependencys missing?

Thank you for any Help or Suggestion.


My Chat.xhtml

Code: Select all

<p:socket onMessage="alert" channel="" autoConnect="false" widgetVar='subscriber' />
Chatbean

Code: Select all

	

@ManagedBean
@SessionScoped
public class ChatBean {...

public void prerenderSession(ComponentSystemEvent event){
		
		RequestContext requestContext = RequestContext.getCurrentInstance();
		String username = logedinUser.getNickname();
		requestContext.execute("PF('subscriber').connect('/" + username + "')");
	}
ChatResource wirth PathParam

Code: Select all

public class ChatResource {
	 
	    @PathParam("user")
	    private String username;
	    
		@EJB
		private ChatLoggerService chatLoggerService;
		
	    @OnOpen
	    public void onOpen(RemoteEndpoint r, EventBus eventBus) {
	    	HttpSession session = (HttpSession) FacesContext
					.getCurrentInstance().getExternalContext()
					.getSession(false);
			
			User logedinUser = (User) session.getAttribute("user");
			username = logedinUser.getNickname();
	    	chatLoggerService.logInfo("OnOpen", r);
	        eventBus.publish("/*", new FacesMessage(String.format("%s has entered the room '%s'",  username)));
	    }
	 
	    @OnClose
	    public void onClose(RemoteEndpoint r, EventBus eventBus) {
	    	HttpSession session = (HttpSession) FacesContext
					.getCurrentInstance().getExternalContext()
					.getSession(false);
			
			User logedinUser = (User) session.getAttribute("user");
			username = logedinUser.getNickname();
	    	chatLoggerService.logInfo("OnClose", r);
	        eventBus.publish("/*", new FacesMessage(String.format("%s has left the room", username)));
	    }
	 
	    @OnMessage(decoders = {JSONDecoder.class}, encoders = {JSONEncoder.class})
	    public FacesMessage onMessage(FacesMessage message) {
	        return message;
	    }
}

Code: Select all

	private void PushNotification(String channel, FacesMessage facesMessage){
    	if(facesMessage == null) return;
    	if(channel == null) return;
    	
    	EventBus eventBus = EventBusFactory.getDefault().eventBus();
    	eventBus.publish("/" + channel, facesMessage);
    }
My web.xml:

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.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.broadcastFilterClasses</param-name>
            <param-value>org.atmosphere.client.TrackMessageSizeFilter</param-value>
        </init-param>
         <init-param> 
		   <param-name>org.atmosphere.cpr.AtmosphereHandler</param-name> 
		   <param-value>org.primefaces.comet.PrimeFacesCometHandler</param-value> 
		</init-param> 
        <init-param>
            <param-name>org.atmosphere.cpr.sessionSupport</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
	<servlet-mapping>
		<servlet-name>Push Servlet</servlet-name>
		<url-pattern>/primepush/*</url-pattern>
	</servlet-mapping>
	<filter>
pom.xml

Code: Select all

	<dependency>
	    <groupId>org.primefaces</groupId>
	  	<artifactId>primefaces</artifactId>
	  	<version>5.0</version>
	  	<scope>runtime</scope>
	</dependency>
	    <dependency>
        <groupId>org.atmosphere.jboss.as</groupId>
        <artifactId>jboss-as-websockets</artifactId>
        <version>0.5</version>
    </dependency>
		<dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>atmosphere-runtime-native</artifactId>
            <version>2.0.0</version>
        </dependency>
	<dependency>
	    <groupId>org.atmosphere</groupId>
	    <artifactId>atmosphere-compat-jbossweb</artifactId>
	    <version>1.0.1</version>
	    <scope>runtime</scope>
	</dependency>
	<dependency>
		<groupId>org.atmosphere</groupId>
		<artifactId>atmosphere-compat-tomcat</artifactId>
		<version>2.0.1</version>
		<scope>runtime</scope>
	</dependency>
	<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-api</artifactId>
		<version>1.7.7</version>
		<scope>runtime</scope>
19:54:44,236 ERROR [org.atmosphere.cpr.AsynchronousProcessor] (http-localhost-127.0.0.1-8080-2) No AtmosphereHandler found. Make sure you define it inside WEB-INF/atmosphere.xml or annotate using @___Service
19:54:44,242 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/chatroom].[Push Servlet]] (http-localhost-127.0.0.1-8080-2) Servlet.service() for servlet Push Servlet threw exception: org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler found. Make sure you define it inside WEB-INF/atmosphere.xml or annotate using @___Service
at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:186) [atmosphere-runtime-native-2.0.0.jar:2.0.0]
at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:163) [atmosphere-runtime-native-2.0.0.jar:2.0.0]
at org.atmosphere.container.JBossWebSocketSupport.service(JBossWebSocketSupport.java:72) [atmosphere-runtime-native-2.0.0.jar:2.0.0]
at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1675) [atmosphere-runtime-native-2.0.0.jar:2.0.0]
at org.atmosphere.cpr.AtmosphereServlet.event(AtmosphereServlet.java:315) [atmosphere-runtime-native-2.0.0.jar:2.0.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilterEvent(ApplicationFilterChain.java:494) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilterEvent(ApplicationFilterChain.java:399) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:273) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2039) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_15]

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

02 Jun 2014, 11:33

you're using the following? interesting.

Code: Select all

      <init-param> 
         <param-name>org.atmosphere.cpr.AtmosphereHandler</param-name> 
         <param-value>org.primefaces.comet.PrimeFacesCometHandler</param-value> 
      </init-param> 
can you search this forum (or atmosphere framework google groups mail list) for others that are using jboss 7.x, successfully?

are you using servlet 3.0 in your 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

ryildiz
Posts: 33
Joined: 19 Jul 2012, 16:43
Location: Kurtkoy/Istanbul
Contact:

10 Jun 2014, 09:32

I encounter same issue.
Primefaces 5.0 push on weblogic 12C raises "No AtmosphereHandler found" error.
Showcase Counter example is considered in a JSF-Spring sample project.
Please have a look at this post:
http://forum.primefaces.org/viewtopic.php?f=10&t=38468
Ramazan YILDIZ
Senior Software Developer Engineer
Netas RnD
ramazangsu[at]gmail.com

gustavo.stork
Posts: 1
Joined: 08 Jul 2014, 15:22

08 Jul 2014, 15:28

So you make download the primefaces showcase. There have all libs current, you need the atmosphere-runtime-2.1.3.jar. :D

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 25 guests