Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.3-core
    • Fix Version/s: 1.2.10-core, 1.0.10-core
    • Component/s: Components
    • Labels:
      None
    • Environment:
      Trinidad-1.2.3 + Tomcat 6

      Description

      I get the following NPE for a tr:messages tag using Trinidad-1.2.3:

      java.lang.NullPointerException
      at org.apache.catalina.connector.CoyoteWriter.write(CoyoteWriter.java:171)
      at org.apache.myfaces.trinidadinternal.io.HtmlResponseWriter.write(HtmlResponseWriter.java:341)
      at org.apache.myfaces.trinidadinternal.io.ResponseWriterDecorator.write(ResponseWriterDecorator.java:162)
      at org.apache.myfaces.trinidadinternal.io.IndentingResponseWriter.write(IndentingResponseWriter.java:152)
      at org.apache.myfaces.trinidadinternal.io.ResponseWriterDecorator.write(ResponseWriterDecorator.java:162)
      at org.apache.myfaces.trinidadinternal.io.DebugResponseWriter.write(DebugResponseWriter.java:124)
      at org.apache.myfaces.trinidadinternal.io.ResponseWriterDecorator.write(ResponseWriterDecorator.java:162)
      at com.sun.facelets.StateWriter.write(StateWriter.java:116)
      at org.apache.myfaces.trinidadinternal.io.HtmlResponseWriter.write(HtmlResponseWriter.java:341)
      at org.apache.myfaces.trinidadinternal.io.ResponseWriterDecorator.write(ResponseWriterDecorator.java:162)
      at org.apache.myfaces.trinidadinternal.io.IndentingResponseWriter.write(IndentingResponseWriter.java:152)
      at org.apache.myfaces.trinidadinternal.io.ResponseWriterDecorator.write(ResponseWriterDecorator.java:162)
      at org.apache.myfaces.trinidadinternal.io.DebugResponseWriter.write(DebugResponseWriter.java:124)
      at org.apache.myfaces.trinidadinternal.io.ResponseWriterDecorator.write(ResponseWriterDecorator.java:162)
      at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.MessageBoxRenderer._renderMessageAnchor(MessageBoxRenderer.java:305)
      at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.MessageBoxRenderer._renderComponentMessages(MessageBoxRenderer.java:263)
      at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.MessageBoxRenderer._renderContent(MessageBoxRenderer.java:204)
      at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.MessageBoxRenderer$BoxRenderer.renderBody(MessageBoxRenderer.java:453)
      at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelBoxRenderer._renderMiddleRow(PanelBoxRenderer.java:267)
      at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelBoxRenderer.encodeAll(PanelBoxRenderer.java:115)
      at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.MessageBoxRenderer.encodeAll(MessageBoxRenderer.java:142)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:220)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:749)

      A validator throws a ValidatorException with a FaceMessage inside.

      All resource bundles are defined in the faces-config.xml file if that makes a difference - e.g. no f:loadBundle's.

      Hope this helps !

      1. trinidad795.patch
        0.7 kB
        Jesper Pedersen

        Activity

        Hide
        Thorsten Guenther added a comment -

        Can also be reproduced with: Converter in <tr:inputText> throwing a ConverterException with a FaceMessage inside.

        Caused by: FacesMessageWrapper constructed with a null label. The null label is ultimately given to the ResponseWriter which triggers the NPE. I dont know if FacesMessageWrapper should not be constructed with a null label or if MessageBoxRenderer should not render the label if its null. So I can't provide a patch.

        Work around: Use org.apache.myfaces.trinidad.util.LabeledFacesMessage instead of javax.faces.application.FacesMessage in your validator / converter with message.setLabel("") .

        Show
        Thorsten Guenther added a comment - Can also be reproduced with: Converter in <tr:inputText> throwing a ConverterException with a FaceMessage inside. Caused by: FacesMessageWrapper constructed with a null label. The null label is ultimately given to the ResponseWriter which triggers the NPE. I dont know if FacesMessageWrapper should not be constructed with a null label or if MessageBoxRenderer should not render the label if its null. So I can't provide a patch. Work around: Use org.apache.myfaces.trinidad.util.LabeledFacesMessage instead of javax.faces.application.FacesMessage in your validator / converter with message.setLabel("") .
        Hide
        Jesper Pedersen added a comment -

        The following patch is against the 1.2.4-branch and uses summary if no label is specified.

        It fixes the NPE, but the question is if it is the correct fix in the long run.

        Show
        Jesper Pedersen added a comment - The following patch is against the 1.2.4-branch and uses summary if no label is specified. It fixes the NPE, but the question is if it is the correct fix in the long run.
        Hide
        Matthias Weßendorf added a comment -

        looks like fixed due to TRINIDAD-1278

        Show
        Matthias Weßendorf added a comment - looks like fixed due to TRINIDAD-1278

          People

          • Assignee:
            Matthias Weßendorf
            Reporter:
            Jesper Pedersen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development