NoClassDefFoundError

UI Components for JSF
Pablovp
Posts: 23
Joined: 22 Aug 2012, 15:32

27 Aug 2012, 10:40

I have it like in the showcase:

counter.xhtml

Code: Select all

<p:socket onMessage="handleMessage" channel="/counter" />
GlobalCounterBean.java

Code: Select all

PushContext pushContext = PushContextFactory.getDefault().getPushContext();
pushContext.push("/counter", String.valueOf(count));

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

27 Aug 2012, 11:07

Do you think the problem could be in my web.xml? Or probably I'm missing something else somewhere...

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
	version="3.0">
	<!-- Faces Servlet -->	
	<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>/faces/*</url-pattern>
	</servlet-mapping>	
	<!-- Atmosphere Servlet -->
    <servlet>
        <description>AtmosphereServlet</description>
        <servlet-name>AtmosphereServlet</servlet-name>
        <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class>
        <!-- If you want to use Servlet 3.0 -->
        <async-supported>true</async-supported>
        <!-- List of init-param --> 
    </servlet>
    <servlet-mapping>
        <servlet-name>AtmosphereServlet</servlet-name>
        <!-- Any mapping -->
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
	<context-param>
		<param-name>primefaces.PUSH_SERVER_URL</param-name>
		<param-value>http://localhost:8080</param-value>
	</context-param>
</web-app>

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

27 Aug 2012, 16:33

So definitely I'm lost somewhere else...

I have discovered that the handleMessage function in JavaScript wasn't defined and after defining it, I get a bunch of errors and warnings in FireBug:
"NetworkError: 404 Not Found - http://localhost:8080/LB2-InfoSys-ui-we ... che-Date=0"
Firefox can't establish a connection to the server at ws://localhost:8080/LB2-InfoSys-ui-web/primepush/counter?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=1.0&X-Atmosphere-Transport=websocket&X-Cache-Date=0.
...dyState==3&&ak.status==200&&aj.transport!="long-polling"){ao=true}else{clearTime...
Websocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent).
Websocket closed, wasClean: false
Websocket failed. Downgrading to Comet and resending
GET http://localhost:8080/LB2-InfoSys-ui-we ... 6077127655
"NetworkError: 404 Not Found - http://localhost:8080/LB2-InfoSys-ui-we ... 6077127655"
SyntaxError: JSON.parse: unexpected character
...this,e)})},prop:function(e,bY){return bF.access(this,bF.prop,e,bY,arguments.leng...

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

05 Sep 2012, 15:04

The problem, among some others, is that I was using JBoss and the counter example use WebSockets that are not supported by Atmosphere in JBoss. Thanks!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 30 guests