EventBusFactory.getDefault().eventBus() nullPointerException

UI Components for JSF
Post Reply
djanthony93
Posts: 7
Joined: 18 Nov 2016, 00:29

18 Nov 2016, 00:34

[*]Hello, I'm using Primefaces 6.0 to run the counter push example in the Push Showcase. Unfortunally there's two issues, first the Aristo theme isn't loaded and showed, second the

EventBus eventBus = EventBusFactory.getDefault().eventBus(); code line raise a nullPointerException.

This is my web.xml:

Code: Select all

<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">
  
  <welcome-file-list>
    <welcome-file>index.xhtml</welcome-file>
  </welcome-file-list>

  <context-param>
    <param-name>primefaces.THEME</param-name>
    <param-value>aristo</param-value>
  </context-param>

  <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>*.xhtml</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>Push Servlet</servlet-name>
    <servlet-class>org.primefaces.push.PushServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    <async-supported>true</async-supported>
  </servlet>
  <servlet-mapping>
    <servlet-name>Push Servlet</servlet-name>
    <url-pattern>/primepush/*</url-pattern>
  </servlet-mapping>


</web-app>
This is my full project: https://mega.nz/#!IpcxSJjR!WSPwLDK4O11f ... FPEl7GRngg.

I'm using Maven for dependecies, Tomcat 9 and Intellij IDEA Ultimate.

djanthony93
Posts: 7
Joined: 18 Nov 2016, 00:29

18 Nov 2016, 14:10

I tried different solutions, first using @Inject make it works but it will increment the count variable on page refreshes too. That's not normal.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 28 guests