ICEfaces
  1. ICEfaces
  2. ICE-6864

MyFaces' state writing triggers NPE in DOMResponseWriter

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.1-Beta, 3.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      MyFaces 2.1.0-SNAPSHOT on Tomcat7
    • Assignee Priority:
      P3

      Description

      MyFaces calls #cloneWithWriter using its StateWriter, which goes through some acrobatics, the upshot of which is that DOMResponseWriter#startElement is called sometime after DOMResponseWriter#endDocument. #startElement appropriately creates a new Document if its document reference is null, then calls #appendToCursor which, finding that the cursor instance variable is null, assigns that to document.getDocumentElement(). Unfortunately the Document, having just been instantiated, has no document element. What seems like the obvious way to address this issue is to re-check the cursor, i.e.:

                   if (cursor == null) {
                       cursor = document.getDocumentElement();
      + if (cursor == null) {
      + cursor = document;
      + }
                   }

      This may be naively missing something; WDYT?

        Issue Links

          Activity

          Repository Revision Date User Message
          ICEsoft Public SVN Repository #25118 Wed Jul 27 14:27:34 MDT 2011 deryk.sinotte ICE-6864: additional check for null documentElement
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/context/DOMResponseWriter.java

            People

            • Assignee:
              Deryk Sinotte
              Reporter:
              Matt Benson
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: