NullPointerException is thrown when eventProducer attribute is added to <a4j:push> component.

Solution Verified - Updated -

Issue

  • NullPointerException is thrown when eventProducer attribute is added to <a4j:push> component.  When running on the server it produces the following exception:

    SEVERE [viewhandler] Error Rendering View[/pages/push.xhtml]
    java.lang.NullPointerException
     at org.ajax4jsf.component.UIPush.getListener(UIPush.java:64)
     at org.ajax4jsf.component.UIPush.encodeBegin(UIPush.java:57)
     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
     at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
     at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
     at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
     at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
     at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
    ...
    

Environment

  • JBoss Enterprise Application Platform (EAP) 5
  • RichFaces
  • Code that appears to trigger the issue, If the attribute eventProducer="#{dataBean.addListener}" is removed, the page runs correctly:

    <h:form id="dataForm">
        <a4j:push enabled="#{dataBean.enabled}" interval="2000"
            timeout="3000" id="push" eventProducer="#{dataBean.addListener}"
            limitToList="true"
            reRender="push, tempResults, start, stop" data="#{dataBean.values}"/>
    </h:form>
    

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content