Forums

angle-left Back

Primefaces push service Null pointer exception

Abdul Ahad Arain, modified 1 Year ago.

Primefaces push service Null pointer exception

New Member Posts: 14 Join Date: 5/18/17 Recent Posts
I am using primesfaces for frontend development and i want to implement primefaces push service but i am getting a null pointer exception while initializing/publishing an eventbus.I have done my searching but have come up with no solution, i am thinking there might be some problem with liferay and primefaces integration.

My Current setup:

  • liferay 6.2
  • tomcat 7
  • primefaces 5.2


PS:This is my first time here on liferay forums therefore if i am posting this in the wrong place or if any information is missing please guide, thanks in advance.
Kyle Joseph Stiemann, modified 1 Year ago.

RE: Primefaces push service Null pointer exception

LIFERAY STAFF Liferay Master Posts: 655 Join Date: 1/14/13 Recent Posts
Hi Abdul,
Please post the versions of the Liferay Faces jars that you are using. Also just for the benefit of other users: this question was also posted on StackOverflow.

- Kyle
Abdul Ahad Arain, modified 1 Year ago.

RE: Primefaces push service Null pointer exception

New Member Posts: 14 Join Date: 5/18/17 Recent Posts
I am not sure from where i can find that in my setup ... and yes i posted that question and also saw your answer but before i could produce that error i am facing the above mentioned problem..
Kyle Joseph Stiemann, modified 1 Year ago.

RE: Primefaces push service Null pointer exception

LIFERAY STAFF Liferay Master Posts: 655 Join Date: 1/14/13 Recent Posts
Hi Abdul,
I'll just try to reproduce your error with the latest jars today. For future reference, you can find the versions of the liferay faces jars in the dependencies section of your pom.xml (for maven projects), or your build.gradle file (for gradle projects), or your ivy.xml (for ant projects). I'll let you know what my findings are with the latest jars in Liferay 6.2 (note that LPS-72753 prevents PrimeFaces Push from working in Liferay 7 right now). Please let me know if you are using maven, gradle, or ant to build your project and what Liferay Faces versions you are using.

- Kyle
Kyle Joseph Stiemann, modified 1 Year ago.

RE: Primefaces push service Null pointer exception

LIFERAY STAFF Liferay Master Posts: 655 Join Date: 1/14/13 Recent Posts
Hi Abdul,
Here is a demo portlet that I've created for Liferay 6.2 with PrimeFaces 6.1 Push: https://github.com/stiemannkj1/liferay-faces-bridge-impl/tree/develop-primepush-cdi-counter-portlet-demo-FACES-1387-4.x/demo/primepush-cdi-counter-portlet

It's still a work in progress, but if you take a look at the example code, you should be able to get it working in your environment for your use case.

- Kyle
Abdul Ahad Arain, modified 1 Year ago.

RE: Primefaces push service Null pointer exception

New Member Posts: 14 Join Date: 5/18/17 Recent Posts
My project is ant based and it is around 1 and half year old, the liferay-faces jars were manually imported into the lib folder not defined in the ivy.xml therefore i am unable to check their version.
I am still getting the null pointer exception on:
EventBus eventBus = EventBusFactory.getDefault().eventBus();
link to image of jars
Kyle Joseph Stiemann, modified 1 Year ago.

RE: Primefaces push service Null pointer exception

LIFERAY STAFF Liferay Master Posts: 655 Join Date: 1/14/13 Recent Posts
Hi Abdul,
It sounds like you are missing a dependency which will handle @Inject. I would recommend CDI and Weld Servlet.

It seems like you are also using old versions of Liferay Faces jars. You should upgrade to our latest release. Check out the archetype portlet at liferayfaces.org to find out which jars you need.

I've also attached the demo portlet war which you can try to deploy in your environment.

- Kyle
Abdul Ahad Arain, modified 9 Months ago.

RE: Primefaces push service Null pointer exception

New Member Posts: 14 Join Date: 5/18/17 Recent Posts
My null pointer exception is resolved, but now I am having same error produced on prism faces website
Kyle Joseph Stiemann, modified 9 Months ago.

RE: Primefaces push service Null pointer exception

LIFERAY STAFF Liferay Master Posts: 655 Join Date: 1/14/13 Recent Posts
Hi Abdul,
I think the PrimeFaces showcase error may stem from a lack of https support in p:socket. If you are reproducing the error in your portlet, I'd recommend creating a webapp reproducer and creating a new PrimeFaces issue (not a PrimeFaces Showcase issue like the one I linked) with steps to reproduce. And for now, try developing/testing with http only. For any other issues, you can take a look at our JSF 2.2 PrimePush example portlet here: https://github.com/liferay/liferay-faces-bridge-impl/tree/4.1.0/demo/primepush-cdi-counter-portlet

Side note to any Liferay 7.0 users reading this: PrimePush won't work in Liferay 7.0 until a version is released with the following issues fixed (or you are using the latest fix packs in DXP): LPS-62552 and LPS-72880.

- Kyle
Abdul Ahad Arain, modified 9 Months ago.

RE: Primefaces push service Null pointer exception

New Member Posts: 14 Join Date: 5/18/17 Recent Posts
I created a new liferay (6.2) ant based portlet project with following ivy.xml and web.xml settings

  • ive.xml

<?xml version="1.0"?>
<ivy-module
version="2.0"
xmlns:m2="http://ant.apache.org/ivy/maven"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
>
<info module="portlet_primefaces_tmpl" organisation="com.liferay">
<extends extendType="configurations,description,info" location="../../ivy.xml" module="com.liferay.sdk" organisation="com.liferay" revision="latest.integration" />
</info>

<dependencies defaultconf="default">
<dependency name="jboss-el" org="org.jboss.el" rev="2.0.1.GA" />
<dependency name="jsf-api" org="com.sun.faces" rev="2.1.21" />
<dependency name="jsf-impl" org="com.sun.faces" rev="2.1.21" />
<dependency name="liferay-faces-bridge-api" org="com.liferay.faces" rev="3.2.4-ga5" />
<dependency name="liferay-faces-bridge-impl" org="com.liferay.faces" rev="3.2.4-ga5" />
<dependency name="liferay-faces-portal" org="com.liferay.faces" rev="3.2.4-ga5" />
<dependency name="liferay-faces-util" org="com.liferay.faces" rev="3.2.4-ga5" />
<!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
<dependency org="org.primefaces" name="primefaces" rev="5.2"/>
<dependency conf="test->default" name="arquillian-junit-container" org="org.jboss.arquillian.junit" rev="1.1.6.Final" />
<dependency conf="test->default" name="arquillian-tomcat-remote-7" org="org.jboss.arquillian.container" rev="1.0.0.CR6" />
<dependency conf="test->default" name="com.liferay.ant.arquillian" org="com.liferay" rev="1.0.0-SNAPSHOT" />
<!-- https://mvnrepository.com/artifact/org.atmosphere/atmosphere-runtime -->
<dependency org="org.atmosphere" name="atmosphere-runtime" rev="2.4.14"/>
<!-- https://mvnrepository.com/artifact/org.atmosphere/atmosphere-runtime-native -->
<dependency org="org.atmosphere" name="atmosphere-runtime-native" rev="2.4.14"/>
<!-- https://mvnrepository.com/artifact/org.jboss.weld.servlet/weld-servlet -->
<dependency org="org.jboss.weld.servlet" name="weld-servlet" rev="2.4.5.Final"/>
</dependencies>
</ivy-module>

  • web.xml


<?xml version="1.0"?>

<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Push Servlet</servlet-name>
<servlet-class>org.primefaces.push.PushServlet</servlet-class>
<init-param>
<param-name>org.atmosphere.cpr.broadcasterCacheClass</param-name>
<param-value>org.atmosphere.cache.UUIDBroadcasterCache</param-value>
</init-param>
<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>

After this, there are no errors but also there is no output these values is updated at the backend but not on the front end.
Kyle Joseph Stiemann, modified 9 Months ago.

RE: Primefaces push service Null pointer exception

LIFERAY STAFF Liferay Master Posts: 655 Join Date: 1/14/13 Recent Posts
You should upgrade to the latest Liferay Faces and JSF jars. You can find the latest jar versions here (select Liferay 6.2, JSF 2.1, and PrimeFaces from the dropdowns): http://liferayfaces.org/. You may also need to update the names of the jars since the Liferay Faces artifacts have changed somewhat in recent releases.

- Kyle
Abdul Ahad Arain, modified 9 Months ago.

RE: Primefaces push service Null pointer exception

New Member Posts: 14 Join Date: 5/18/17 Recent Posts
after updating my jars I am stuck with this error :
Sep 21, 2017 12:10:22 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet TestPush Servlet threw exception
java.lang.NullPointerException
at org.jboss.weld.servlet.WeldListener.requestContext(WeldListener.java:93)
at org.jboss.weld.servlet.WeldListener.requestInitialized(WeldListener.java:190)
at org.jboss.weld.servlet.WeldCrossContextFilter.doFilter(WeldCrossContextFilter.java:58)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)
at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:583)
at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:656)
at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:362)
at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1242)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.portlet.PortletContainerImpl._doRender(PortletContainerImpl.java:655)
at com.liferay.portlet.PortletContainerImpl.render(PortletContainerImpl.java:138)
at com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrapper.java:141)
at com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrapper.java:126)
at com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:156)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer._render(PortletRenderer.java:125)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer.render(PortletRenderer.java:72)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doProcessTemplate(RuntimePageImpl.java:452)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doDispatch(RuntimePageImpl.java:284)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.processTemplate(RuntimePageImpl.java:113)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.processTemplate(RuntimePageImpl.java:124)
at com.liferay.portal.layoutconfiguration.util.RuntimePageUtil.processTemplate(RuntimePageUtil.java:69)
at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portlet_jsp.java:557)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)
at com.liferay.portal.action.LayoutAction.includeLayoutContent(LayoutAction.java:302)
at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:405)
at com.liferay.portal.action.LayoutAction.doExecute(LayoutAction.java:200)
at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:95)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:179)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:549)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:526)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:293)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:360)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:293)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:243)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:267)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:320)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:185)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
at com.liferay.portal.servlet.filters.urlrewrite.UrlRewriteFilter.processFilter(UrlRewriteFilter.java:57)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:165)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:165)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:185)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Kyle Joseph Stiemann, modified 9 Months ago.

RE: Primefaces push service Null pointer exception

LIFERAY STAFF Liferay Master Posts: 655 Join Date: 1/14/13 Recent Posts
Hi Abdul,
Sorry, I forgot to mention that we only support PrimeFaces Push with our JSF 2.2 branch (which should be fine for you since you are using Tomcat). Can you try the demo portlet to see if it works correctly in your environment? You can follow these steps to try the demo portlet:

  • Clone the project:

    git clone https://github.com/liferay/liferay-faces-bridge-impl.git

  • Check out the latest release tag that includes the PrimePush Counter Portlet demo:

    git checkout 4.1.0

  • Build the demo:

    cd demo/primepush-cdi-counter-portlet &&
    mvn clean package -P liferay,liferay62,mojarra,tomcat


  • Deploy the demo to Liferay:

    cp target/com.liferay.faces.demo.primepush.cdi.counter.portlet-4.1.0.war \
    $LIFERAY_62_HOME/deploy/com.liferay.faces.demo.primepush.cdi.counter.portlet.war


  • Add the portlet to a page, open another browser on the same page, click the button, and check that the counter is updated in both browsers.


If the PrimePush demo works, then you can copy the the demo's source and config and replace the working functionality with the functionality that you need.

- Kyle
Abdul Ahad Arain, modified 8 Months ago.

RE: Primefaces push service Null pointer exception

New Member Posts: 14 Join Date: 5/18/17 Recent Posts
In the end i was able to resolve my issue by using following configurations
->jars->
1:primefaces version 5.3
2:atmosphere run time version 2.4.0
3:javax inject version 1

->web.xml->
<servlet>
<servlet-name>Push Servlet</servlet-name>
<servlet-class>org.primefaces.push.PushServlet</servlet-class>
<init-param>
<param-name>org.atmosphere.cpr.broadcasterCacheClass</param-name>
<param-value>org.atmosphere.cache.UUIDBroadcasterCache</param-value>
</init-param>
<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>
Kyle Joseph Stiemann, modified 8 Months ago.

RE: Primefaces push service Null pointer exception

LIFERAY STAFF Liferay Master Posts: 655 Join Date: 1/14/13 Recent Posts
Glad you got it working, Abdul, thanks for posting the solution! And thanks for using Liferay Faces!