Board index JavaServer Faces Push Push Chat under Tomcat - org/atmosphere/cpr/AsyncSupportList

Push Chat under Tomcat - org/atmosphere/cpr/AsyncSupportList

Push Framework with Atmosphere


Posts: 24
Hello guys,

I am using PF 3.5 and Tomcat 7. I added the maven dependencies:

    <dependency>
        <groupId>org.atmosphere</groupId>
        <artifactId>atmosphere-runtime</artifactId>
        <version>1.0.1</version>
    </dependency>
     
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.1</version>
    </dependency>
     
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.7.1</version>
    </dependency>


And as xhtml I added the show Case project from the PF Page.

When I start my chat.xhtml I get:
org/atmosphere/cpr/AsyncSupportListenerAdapter


1100: org/atmosphere/cpr/AsyncSupportListenerAdapter
java.lang.NoClassDefFoundError: org/atmosphere/cpr/AsyncSupportListenerAdapter
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
   at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
   at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1148)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1643)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
   at org.primefaces.push.PushContextFactory.<init>(PushContextFactory.java:27)
   at org.primefaces.push.PushContextFactory.<clinit>(PushContextFactory.java:23)
   at org.inso_ase01.genplace.fileHandler.ChatView.<init>(ChatView.java:17)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at java.lang.Class.newInstance0(Class.java:357)
   at java.lang.Class.newInstance(Class.java:310)
   at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186)
   at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:100)
   at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
   at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
   at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244)
   at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116)
   at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
   at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
   at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:71)
   at org.apache.el.parser.AstValue.getValue(AstValue.java:147)
   at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
   at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
   at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
   at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:462)
   at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:52)
   at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:47)
   at org.primefaces.component.fieldset.FieldsetRenderer.encodeContent(FieldsetRenderer.java:90)
   at org.primefaces.component.fieldset.FieldsetRenderer.encodeMarkup(FieldsetRenderer.java:72)
   at org.primefaces.component.fieldset.FieldsetRenderer.encodeEnd(FieldsetRenderer.java:46)
   at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924)
   at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854)
   at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
   at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:894)
   at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1847)
   at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1850)
   at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1850)
   at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:440)
   at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
   at com.ocpsoft.pretty.faces.application.PrettyViewHandler.renderView(PrettyViewHandler.java:163)
   at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
   at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
   at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:202)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:147)
   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
   at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
   at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: org.atmosphere.cpr.AsyncSupportListenerAdapter
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
   ... 77 more


I really appreciate your answer!!!
Hibernate: 4.0.1.Final
Spring: 3.1.1.RELEASE
Primefaces: 5
jsf-version: 2.2.0-m08
Apache Tomcat/7.0.47


Posts: 5935
Try the following:

1. latest version of Tomcat (which is currently, Tomcat 7.0.39)
2. Atmosphere 1.0.12
3. scan this PrimeFaces Push forum for 'tomcat' forum topics, so you can see what other issues were resolved for those people using tomcat-and-primefaces-push
Howard

PrimeFaces 5.1, Extensions 2.1.0, Push (Atmosphere 2.2.3)
TomEE+ 1.7.1 (Tomcat 7.0.55), MyFaces Core 2.2.5, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache


Posts: 435
Not sure if it matters, but do you have following in your web.xml:
  <servlet>
   <servlet-name>Push Servlet</servlet-name>
   <servlet-class>org.primefaces.push.PushServlet</servlet-class>
     <async-supported>true</async-supported>
  </servlet>
  <servlet-mapping>
   <servlet-name>Push Servlet</servlet-name>
   <url-pattern>/primepush/*</url-pattern>
  </servlet-mapping>


This is ALL Push-specific stuff I have in my web.xml and things are working fine. This is with Atmosphere 1.0.12.
Server: Wildfly 8.0.0
JSF: Mojarra 2.2.5
PF version: PrimeFaces 5.0 + Extensions 1.2.1
Other: OmniFaces 1.7.0
Browser: Firefox 2x


Posts: 1
Salam

I have the same problem but with glass fish
I dont use maven but I add directly to the project the atmosphere-runtime-1.0.12.jar
what I need to add to my configuration???
:?:


Posts: 5935
ismail wrote:
Salam

I have the same problem but with glass fish
I dont use maven but I add directly to the project the atmosphere-runtime-1.0.12.jar
what I need to add to my configuration???
:?:


Glassfish 3.1.2.2
Howard

PrimeFaces 5.1, Extensions 2.1.0, Push (Atmosphere 2.2.3)
TomEE+ 1.7.1 (Tomcat 7.0.55), MyFaces Core 2.2.5, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache


Return to Push