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 ?
RequestContext is null chat example
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>
<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>
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
What is the version of your jetty plugin?
The problem was not coming from Jetty at all, but from the chatPage.jsf source. We replaced header section by
instead of
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.
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>
Code: Select all
<ui:define name="head">
<h:outputScript library="js" name="chatScript.js"></h:outputScript>
</ui:define>
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Code: Select all
<ui:define name="head">
-
- Posts: 6
- Joined: 11 Jan 2012, 19:35
- Location: USA
- Contact:
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
First , i thaught that the pushserver and the jsf application mustnt be in the same project. But your code is doing it.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 2 guests