RequestContext is null chat example

UI Components for JSF
Post Reply
cedric
Posts: 5
Joined: 10 Sep 2011, 19:58

27 Dec 2011, 20:06

Hi,

We are trying to run the Push example in the show case, and we have used Jetty as a WebSocket server. We have copy paste the code that we found in the show case. We are stuck on Null Pointer Exception there (ChatController.java)

requestContext.addPartialUpdateTarget("growl");

What we did wrong ?

ghenghis
Posts: 8
Joined: 16 Dec 2011, 19:47

27 Dec 2011, 20:37

Hi this is the configuration from jetty and maven. This solves the problem of Request context null, but still I could not do work the push. I asked for help but nobody gave me an answer or complete example. I hope this code help you.

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>

<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopKey>jetty-stop</stopKey>
<stopPort>9999</stopPort>
<webAppConfig>
<contextPath>/prime-pushserver</contextPath>
</webAppConfig>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>9090</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

27 Dec 2011, 21:04

What is the version of your jetty plugin?

cedric
Posts: 5
Joined: 10 Sep 2011, 19:58

27 Dec 2011, 21:16

The problem was not coming from Jetty at all, but from the chatPage.jsf source. We replaced header section by

Code: Select all

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<h:outputScript library="js" name="chatScript.js"></h:outputScript>
</h:head>
instead of

Code: Select all

	<ui:define name="head">
		<h:outputScript library="js" name="chatScript.js"></h:outputScript>
	</ui:define>
in fact we discovered that without this, head section was not generated in the html page and then, the primefaces js libraries were not loaded, then the request on login was not Ajax, explaining the NPE.

cedric
Posts: 5
Joined: 10 Sep 2011, 19:58

27 Dec 2011, 21:18

optimus.prime wrote:What is the version of your jetty plugin?
8.0.4 last distribution

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

27 Dec 2011, 21:26

Code: Select all

<ui:define name="head">
Yes, that is just an example of showcase, in your app it could be different.

jamesthomka5
Posts: 6
Joined: 11 Jan 2012, 19:35
Location: USA
Contact:

12 Jan 2012, 09:40

This resolves the issue of Ask for perspective zero, but still I could not do function the force. I requested for help but nobody offered me an reply or comprehensive example.
Urban City Rentals Inc. offers a complete range of Rental Property Management services in Vancouver for your investment property.Property Management Delta

saboor
Posts: 1
Joined: 15 Apr 2015, 14:27

15 Apr 2015, 14:30

First , i thaught that the pushserver and the jsf application mustnt be in the same project. But your code is doing it.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests