PF5 Push on Weglogic 12C: No AtmosphereHandler found

UI Components for JSF
Post Reply
ryildiz
Posts: 33
Joined: 19 Jul 2012, 16:43
Location: Kurtkoy/Istanbul
Contact:

09 Jun 2014, 14:40

Hi,

Primefaces 5.0 push on weblogic 12C raises following No AtmosphereHandler found error.
Showcase Counter example is considered in a JSF-Spring sample project. Any comment will be appreciated. Thnks in advance :

Error log:

Code: Select all

Jun 09, 2014 3:19:13 PM org.atmosphere.cpr.AsynchronousProcessor action
SEVERE:No AtmosphereHandler found.Make sure you define it inside WEB-INF/atmosphere.xml or annotate using @___Service
<Jun 9, 2014 3:19:13 PM EEST> <Error> <HTTP> <BEA-101020> <[ServletContext@15799732[app:_auto_generated_ear_ module:Aydes-Gui-war path:null spec-version:3.0]] Servlet failed with an 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:123)
	at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:100)
	at org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66)
	at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1879)
	at org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:210)
	Truncated. see log file for complete stacktrace
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>Aydes Gui</display-name>

  <!-- Add Support for Spring -->
  <listener>
	<listener-class>
		org.springframework.web.context.ContextLoaderListener
	</listener-class>
  </listener>
  <listener>
	<listener-class>
		org.springframework.web.context.request.RequestContextListener
	</listener-class>
  </listener>
  
    <context-param>
        <param-name>primefaces.THEME</param-name>
        <param-value>redmond</param-value>
    </context-param>
    
	<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.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
  
	<welcome-file-list>
		<welcome-file>login.jsf</welcome-file>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>

	<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>*.jsf</url-pattern>
	</servlet-mapping>

	<session-config>
		<session-timeout>180</session-timeout>
	</session-config>
	

    <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.annotation.packages</param-name>
            <param-value>org.primefaces.push</param-value>
   </init-param>
   <init-param>
            <param-name>org.atmosphere.cpr.packages</param-name>
            <param-value>com.netas.aydes.push</param-value>
   </init-param>
    
   
		<init-param>
		   <param-name>org.atmosphere.cpr.atmosphereHandlerPath</param-name>
		   <param-value>/WEB-INF/classes/com/netas/aydes/push/</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>	

</web-app>
Pom.xml dependencies:

Code: Select all

<!-- PUSH -->
			 <dependency>
                <groupId>org.atmosphere</groupId>
                <artifactId>atmosphere-runtime</artifactId>
                <version>2.2.0-RC1</version>
         </dependency>

		<dependency>
			<groupId>org.atmosphere</groupId>
			<artifactId>atmosphere-compat-weblogic</artifactId>
			<version>0.9.0.RC3</version>
		</dependency>

          
         <dependency>
             <groupId>eu.infomas</groupId>
 			 <artifactId>annotation-detector</artifactId>
             <version>3.0.1</version>
         </dependency> 
         
         
         <dependency>
	<groupId>javax</groupId>
	<artifactId>javaee-web-api</artifactId>
	<version>6.0</version>
</dependency>

		 <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>3.0-alpha-1</version>
    </dependency>
		
		<dependency>
			<groupId>javax.faces</groupId>
			<artifactId>jsf-api</artifactId>
			<version>2.0</version>
		</dependency>

		<dependency>
			<groupId>com.sun.faces</groupId>
			<artifactId>jsf-api</artifactId>
			<version>2.0.2</version>
		</dependency>

		<dependency>
			<groupId>com.sun.faces</groupId>
			<artifactId>jsf-impl</artifactId>
			<version>2.0.2</version>
		</dependency>

		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<version>${commonslangver}</version>
		</dependency>

		<dependency>
			<groupId>commons-collections</groupId>
			<artifactId>commons-collections</artifactId>
			<version>3.0</version>
		</dependency>

		<dependency>
			<groupId>com.oracle.weblogic</groupId>
			<artifactId>wlfullclient</artifactId>
			<version>12.1.2</version>
		</dependency>

		<dependency>
			<groupId>org.primefaces</groupId>
			<artifactId>primefaces</artifactId>
			<version>5.0.RC2</version>
		</dependency>
		<dependency>
			<groupId>org.omnifaces</groupId>
			<artifactId>omnifaces</artifactId>
			<version>1.7</version>
		</dependency>
		<dependency>
			<groupId>org.primefaces.extensions</groupId>
			<artifactId>primefaces-extensions</artifactId>
			<version>2.0.0</version>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit4ver}</version>
		</dependency>

		
		<!-- Primefaces Themes -->
		<dependency>
			<groupId>org.primefaces.themes</groupId>
			<artifactId>all-themes</artifactId>
			<version>1.0.9</version>
		</dependency>
		
		
		
		<!-- Spring framework -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>4.0.5.RELEASE</version>
		</dependency>
 
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>4.0.5.RELEASE</version>
		</dependency>
		
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>4.0.5.RELEASE</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>4.0.5.RELEASE</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-tx</artifactId>
			<version>4.0.5.RELEASE</version>
		</dependency>
 
		<!-- JSR-330 -->
		<dependency>
			<groupId>javax.inject</groupId>
			<artifactId>javax.inject</artifactId>
			<version>1</version>
		</dependency>
		
Push.xhtml:

Code: Select all

<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui" xmlns:c="http://java.sun.com/jsp/jstl/core">

<f:view transient="true" contentType="text/html">
    <h:head>
        <meta charset="UTF-8"/>
        <title>push</title>
    </h:head>

    <h:body style="height: auto;">

       	<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" />
		 
		<script type="text/javascript">
		    function handleMessage(data) {
		    	alert('here' );
		    	alert(data);
		        $('.display').html(data);
		    }
		</script>


    </h:body>
</f:view>
</html>
GlobalCounterView.java

Code: Select all

package com.netas.aydes.push;

import java.io.Serializable;


import org.primefaces.push.EventBus;
import org.primefaces.push.EventBusFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
 
@Component
@Scope("session")
public class GlobalCounterView implements Serializable{
 
    /**
	 * 
	 */
	private static final long serialVersionUID = 7098303383097404576L;
	
	private volatile int count;
 
    public int getCount() {
        return count;
    }
 
    public void setCount(int count) {
        this.count = count;
    }
     
    public void increment() {
        count++;
        try{ 
        EventBus eventBus = EventBusFactory.getDefault().eventBus();
        eventBus.publish("/counter", String.valueOf(count));
        }catch(Exception e){
        	e.printStackTrace();
        }
    }
}
CounterResource.java

Code: Select all

package com.netas.aydes.push;


import org.primefaces.push.annotation.OnMessage;
import org.primefaces.push.annotation.PushEndpoint;
import org.primefaces.push.impl.JSONEncoder;
import org.springframework.stereotype.Component;

@Component
@PushEndpoint("/counter")
public class CounterResource {
 
    @OnMessage(encoders = {JSONEncoder.class})
    public String onMessage(String count) {
    	System.out.println("*********** CounterResource ***********");
        return count;
    }
}    
applicationContext.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:task="http://www.springframework.org/schema/task"
	xmlns:util="http://www.springframework.org/schema/util"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd 
						http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
				        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
						http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd
						http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd
						http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">

 	
	<context:annotation-config />
	
	<context:component-scan base-package="com.netas.aydes" >
	</context:component-scan>

</beans>
Ramazan YILDIZ
Senior Software Developer Engineer
Netas RnD
ramazangsu[at]gmail.com

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

10 Jun 2014, 11:17

Nobody commented on this issue yet?
Please share your ideas even though those are not gonna be sensible :p
Ramazan YILDIZ
Senior Software Developer Engineer
Netas RnD
ramazangsu[at]gmail.com

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

11 Jun 2014, 18:28

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:

12 Jun 2014, 20:21

Hi Smithh,

I dont get what do you propose, can you please explain what do you mean;
I use weblogic 12.x with Servlet 3.0, am i missing something ?

By the way thanks for reply.
Ramazan YILDIZ
Senior Software Developer Engineer
Netas RnD
ramazangsu[at]gmail.com

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

12 Jun 2014, 20:33

Sorry Smith,

Now I got you mean, that is to use an atmosphere.xml.
I already tried it. But i couldnt get jersey run on weblogic 12.1.2; i'll work on it and
if i achieve i m gonna commit pf5 push is working with weblogic 12.x.

thanks for reply again.
Ramazan YILDIZ
Senior Software Developer Engineer
Netas RnD
ramazangsu[at]gmail.com

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

12 Jun 2014, 20:57

also, please search this forum and atmosphere forum for other people that are using Weblogic 12 with PrimeFaces Push.

primefaces push forum search for: weblogic (scroll through pages of search results)

atmosphere google groups mail list search: weblogic 12

primefaces push forum search: jersey (there was some discussion about jersey and primefaces push)
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

dennisthemenace
Posts: 2
Joined: 26 Jun 2014, 15:48

26 Jun 2014, 16:02

I am trying to make primefaces push run on weblogic as well. I have the same error.
I found out that oracle wls1212 might be compatible, but the push endpoint should be /ws/* or or /ws/primepush/*

https://github.com/Atmosphere/atmospher ... et-Support

Now, I tried to change web.xml to a different prime push end point, but that change isnt reflected. All requests still go to /primepush/*.
Is there a way to change that?
Thank you. ddm

dennisthemenace
Posts: 2
Joined: 26 Jun 2014, 15:48

26 Jun 2014, 19:25

Anyway, comet fallback should still work, but it doesnt. Trying to get the primefaces showcase notification example to work under weblogic 12.1.2

result is the same exception "No Atmosphere Handler found"

ihostage
Posts: 2
Joined: 09 Sep 2011, 16:59

02 Nov 2014, 11:17

I was able to get to work Prime Push 5.X on WLS 12.1.3, but only long-pooling.

In weblogic.xml you must set property show-archived-real-path-enabled value true:

Code: Select all

<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd">
  ...
  <container-descriptor>
    ...
    <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
    ....
  </container-descriptor>
  ...
</weblogic-web-app>
and in web.xml you must customize param org.atmosphere.cpr.atmosphereHandlerPath of PushServlet:

Code: Select all

<servlet>
    <servlet-name>primePushServlet</servlet-name>
    <servlet-class>org.primefaces.push.PushServlet</servlet-class>
    <init-param>
      <param-name>org.atmosphere.cpr.atmosphereHandlerPath</param-name>
      <param-value>/WEB-INF/lib/_wl_cls_gen.jar</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    <async-supported>true</async-supported>
  </servlet>
  <servlet-mapping>
    <servlet-name>primePushServlet</servlet-name>
    <url-pattern>/primepush/*</url-pattern>
  </servlet-mapping>
PS: With this params i have worked showcase 'Counter' http://www.primefaces.org/showcase/push/counter.xhtml. But this is not WLS WebSocket Native, this is long-pooling.

brboLikus
Posts: 5
Joined: 16 Jan 2015, 14:35

16 Jan 2015, 14:46

Although this is an old post, not much can be found online concerning this problem so I'm going to "reopen" it.

I'm also trying to make Primefaces Push work of Weblogic 12c, and keep getting the error from the title. I use JDeveloper 12.1.3 that comes with an integrated Weblogic server, and the funny thing is that the same code works on the integrated server, but does not work on the "real" one.

I deploy the application as an un-exploded WAR (I've read somewhere that there might be a problem with detecting annotated elements in such app configuration and that an "annotation-detector" library could solve the problem - nothing changed).

Also, to the poster above: what is "_wl_cls_gen.jar" that you reference in your web.xml?

Do you have any advice you could share?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 27 guests