NoClassDefFoundError

Push Framework with Atmosphere
Pablovp
Posts: 23
Joined: 22 Aug 2012, 15:32

22 Aug 2012, 15:55

I'm getting crazy, just trying to follow the basic example of the counter I'm getting on my computer errors and warnings. I've been reading a lot, trying different things, but I haven't managed to avoid them. JBoss version is 7.1.1
15:46:39,588 WARN [org.jboss.modules] (http-localhost-127.0.0.1-8080-1) Failed to define class org.primefaces.push.PushContextImpl in Module "deployment.LB2-InfoSys-ui-web.war:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/primefaces/push/PushContextImpl (Module "deployment.LB2-InfoSys-ui-web.war:main" from Service Module Loader)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)
at org.jboss.modules.Module.loadModuleClass(Module.java:517)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at org.primefaces.push.PushContextFactory.<init>(PushContextFactory.java:27) [primefaces-3.4.RC1.jar:]
at org.primefaces.push.PushContextFactory.<clinit>(PushContextFactory.java:23) [primefaces-3.4.RC1.jar:]
at com.wettpunkt.infosystem.liveEvent.GlobalCounterBean.increment(GlobalCounterBean.java:47) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_05]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_05]
at org.apache.el.parser.AstValue.invoke(AstValue.java:262) [jbossweb-7.0.13.Final.jar:]
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278) [jbossweb-7.0.13.Final.jar:]
at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:39) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:153) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UICommand.broadcast(UICommand.java:300) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.7-jbossorg-2.jar:]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [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.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.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_05]
Caused by: java.lang.NoClassDefFoundError: org/atmosphere/cpr/AsyncSupportListenerAdapter
at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_05]
at java.lang.ClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0_05]
at java.security.SecureClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0_05]
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)
... 45 more
Caused by: java.lang.ClassNotFoundException: org.atmosphere.cpr.AsyncSupportListenerAdapter from [Module "deployment.LB2-InfoSys-ui-web.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 50 more
15:46:39,643 SEVERE [javax.faces.event] (http-localhost-127.0.0.1-8080-1) Received 'java.lang.NoClassDefFoundError' when invoking action listener '#{globalCounterBean.increment}' for component 'j_idt8'
15:46:39,643 SEVERE [javax.faces.event] (http-localhost-127.0.0.1-8080-1) java.lang.NoClassDefFoundError: org/primefaces/push/PushContextImpl
at org.primefaces.push.PushContextFactory.<init>(PushContextFactory.java:27)
at org.primefaces.push.PushContextFactory.<clinit>(PushContextFactory.java:23)
at com.wettpunkt.infosystem.liveEvent.GlobalCounterBean.increment(GlobalCounterBean.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.el.parser.AstValue.invoke(AstValue.java:262)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)
at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:39)
at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:153)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
at javax.faces.component.UICommand.broadcast(UICommand.java:300)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.primefaces.push.PushContextImpl from [Module "deployment.LB2-InfoSys-ui-web.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 37 more
15:46:39,673 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (http-localhost-127.0.0.1-8080-1) JSF1073: javax.faces.event.AbortProcessingException caught during processing of INVOKE_APPLICATION 5 : UIComponent-ClientId=form:j_idt8, Message=java.lang.NoClassDefFoundError: org/primefaces/push/PushContextImpl
15:46:39,683 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (http-localhost-127.0.0.1-8080-1) java.lang.NoClassDefFoundError: org/primefaces/push/PushContextImpl: javax.faces.event.AbortProcessingException: java.lang.NoClassDefFoundError: org/primefaces/push/PushContextImpl
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:182) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UICommand.broadcast(UICommand.java:300) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.7-jbossorg-2.jar:]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [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.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.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_05]
Caused by: java.lang.NoClassDefFoundError: org/primefaces/push/PushContextImpl
at org.primefaces.push.PushContextFactory.<init>(PushContextFactory.java:27) [primefaces-3.4.RC1.jar:]
at org.primefaces.push.PushContextFactory.<clinit>(PushContextFactory.java:23) [primefaces-3.4.RC1.jar:]
at com.wettpunkt.infosystem.liveEvent.GlobalCounterBean.increment(GlobalCounterBean.java:47) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_05]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_05]
at org.apache.el.parser.AstValue.invoke(AstValue.java:262) [jbossweb-7.0.13.Final.jar:]
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278) [jbossweb-7.0.13.Final.jar:]
at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:39) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:153) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
... 25 more
Caused by: java.lang.ClassNotFoundException: org.primefaces.push.PushContextImpl from [Module "deployment.LB2-InfoSys-ui-web.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 37 more
Cheers, Pablo.

njpugh
Posts: 20
Joined: 11 Jul 2012, 09:32

22 Aug 2012, 19:18

Hi,
What version of primefaces are you using?
Are you trying to use the "older" push mechanism or the newer atmosphere integrated one?

Pablovp
Posts: 23
Joined: 22 Aug 2012, 15:32

23 Aug 2012, 14:04

Hi!

I'm using the new PrimeFaces 3.4.RC1 and the code is the same than on the counter example.

Cheers, Pablo.

njpugh
Posts: 20
Joined: 11 Jul 2012, 09:32

23 Aug 2012, 20:36

Have you added all of the dependencies you need for atmosphere and your servlet?
What servelet container are you using?
I think you might need atmosphere-compat-jbossweb, running on tomcat 7.0.29 I also needed atmosphere-compat-tomcat

Pablovp
Posts: 23
Joined: 22 Aug 2012, 15:32

24 Aug 2012, 10:55

I don't think so.

I just added it but the result it's the same:

Code: Select all

<dependency>
    <groupId>org.atmosphere</groupId>
    <artifactId>atmosphere-compat-jbossweb</artifactId>
    <version>0.9.7</version>
    <scope>compile</scope>
 </dependency>
<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>3.4.RC1</version>
    <scope>compile</scope>
</dependency>
I'm new on JSF after two years coding PHP, so I think I'm more lost than what I was thinking...

Pablovp
Posts: 23
Joined: 22 Aug 2012, 15:32

24 Aug 2012, 13:06

Adding this seems I'm not getting the error anymore, even when the push is not working.

Code: Select all

    <dependency>
      <groupId>org.atmosphere</groupId>
      <artifactId>atmosphere-runtime</artifactId>
      <version>1.0.0.beta5</version>
      <scope>compile</scope>
    </dependency>

pangalz
Posts: 8
Joined: 29 Jul 2011, 02:51

24 Aug 2012, 14:02

Pablovp wrote:Adding this seems I'm not getting the error anymore, even when the push is not working.

Code: Select all

    <dependency>
      <groupId>org.atmosphere</groupId>
      <artifactId>atmosphere-runtime</artifactId>
      <version>1.0.0.beta5</version>
      <scope>compile</scope>
    </dependency>

Verify PUSH_SERVER_URL in your web.xml:
<context-param>
<param-name>primefaces.PUSH_SERVER_URL</param-name>
<param-value>http://localhost:80</param-value>
</context-param>

njpugh
Posts: 20
Joined: 11 Jul 2012, 09:32

24 Aug 2012, 21:00

You shouldn't need a push server URL defined I don't think. I think this is just because of the way the showcase is set up on the primefaces server (Think they're running several servers at least one that will run php and another one for the showcase)
What code do you have to define your socket in the xhtml file? And what do you have for pushing a message to the client?

pangalz
Posts: 8
Joined: 29 Jul 2011, 02:51

24 Aug 2012, 22:33

njpugh wrote:You shouldn't need a push server URL defined I don't think. I think this is just because of the way the showcase is set up on the primefaces server (Think they're running several servers at least one that will run php and another one for the showcase)
What code do you have to define your socket in the xhtml file? And what do you have for pushing a message to the client?
i'm using PrimeFaces 3.4.RC1 and new <p:socket> component and I still need setup PUSH_SERVER_URL.
Checkout lastest primefaces-showcase and see the examples.

njpugh
Posts: 20
Joined: 11 Jul 2012, 09:32

25 Aug 2012, 01:27

I have successfully implemented the new push technology in my own project.
In the bean:
PushContextFactory.getDefault().getPushContext().push(CHANNEL, username + " joined the channel.");

In the xhtml:
<p:socket onMessage="handleMessage" channel="CHANNEL" autoConnect="false" widgetVar="subscriber"/>

Where CHANNEL is the same in both files. The only configuration that should be needed is adding the correct jars

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest