Search code examples
jsf-2glassfish-3icefaces-3

NullPointer Exception at org.icefaces.impl.context.DOMResponseWriter.writeText(DOMResponseWriter.java:314)


What can this exception mean exactly?

java.lang.NullPointerException: WriteText method cannot write null text
  at org.icefaces.impl.context.DOMResponseWriter.writeText(DOMResponseWriter.java:314)
  at org.icefaces.impl.context.DOMResponseWriter.writeText(DOMResponseWriter.java:340)

this is only happening when deployed using icefaces autoCompleteEntry tag having value attribute set to backing bean property selectedplcofBirth defined as emptystring "".(i.e. private String selectedplcofBirth="";)

 <ace:autoCompleteEntry id="txtplaceofbirth"
                                      rows="10" autocomplete="false" 
                                        minChars="2" width="150" 
                                        value="#{inputPersonal.selectedplcofBirth}" 
                                        filterMatchMode="none"  
                                       valueChangeListener="#{inputPersonal.valueChangeEventCity}">
                                        <f:selectItems value="#{inputPersonal.cities}"/>

                                        </ace:autoCompleteEntry></h:outputFormat>

Solution

  • You omitted the most important line of the stacktrace, the line thereafter:

    at com.sun.faces.renderkit.html_basic.OutputMessageRenderer.encodeEnd(OutputMessageRenderer.java:163)
    

    (see also this exact duplicate question of your colleague or clone account)

    This exception occurs in older Mojarra versions when <h:outputFormat> is been used without value or null as value. E.g.

    <h:outputFormat value="#{null}">...</h:outputFormat>
    

    or

    <h:outputFormat>...</h:outputFormat>
    

    You should make sure that it is not null, or if the tag has no purpose at all, as confirmed by your comment on the question, just remove it altogether. Use a <h:panelGroup> instead. Or just learn CSS properly and fix your CSS selector.