ICEfaces
  1. ICEfaces
  2. ICE-1995

DOMResponseWriter DOMExceptions prevent any informative logging about the problem element

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 1.6
    • Fix Version/s: 1.6.1
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      n/a

      Description

      If the DOMResponseWriter runs into a DOM_HIERARCHY_ERR (DOMException) exception, nothing about the problem element is written to the logs.

      Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/core/src/com/icesoft/faces/context/DOMResponseWriter.java
      ===================================================================
      --- D:/Documents and Settings/pbreau/workspace/ICEfaces/core/src/com/icesoft/faces/context/DOMResponseWriter.java (revision 14650)
      +++ D:/Documents and Settings/pbreau/workspace/ICEfaces/core/src/com/icesoft/faces/context/DOMResponseWriter.java (working copy)
      @@ -33,18 +33,15 @@
       
       package com.icesoft.faces.context;
       
      -import com.icesoft.faces.application.D2DViewHandler;
      -import com.icesoft.faces.application.StartupTime;
      -import com.icesoft.faces.context.effects.JavascriptContext;
      -import com.icesoft.faces.util.CoreUtils;
      -import com.icesoft.faces.webapp.http.common.Configuration;
      -import com.icesoft.jasper.Constants;
      -import org.apache.commons.logging.Log;
      -import org.apache.commons.logging.LogFactory;
      -import org.w3c.dom.Document;
      -import org.w3c.dom.Element;
      -import org.w3c.dom.Node;
      -import org.w3c.dom.NodeList;
      +import java.beans.Beans;
      +import java.io.IOException;
      +import java.io.Writer;
      +import java.util.ArrayList;
      +import java.util.Collection;
      +import java.util.HashMap;
      +import java.util.Iterator;
      +import java.util.Locale;
      +import java.util.Map;
       
       import javax.faces.FacesException;
       import javax.faces.application.ViewHandler;
      @@ -55,16 +52,22 @@
       import javax.xml.parsers.DocumentBuilder;
       import javax.xml.parsers.DocumentBuilderFactory;
       import javax.xml.parsers.ParserConfigurationException;
      -import java.beans.Beans;
      -import java.io.IOException;
      -import java.io.Writer;
      -import java.util.ArrayList;
      -import java.util.Collection;
      -import java.util.HashMap;
      -import java.util.Iterator;
      -import java.util.Locale;
      -import java.util.Map;
       
      +import org.apache.commons.logging.Log;
      +import org.apache.commons.logging.LogFactory;
      +import org.w3c.dom.DOMException;
      +import org.w3c.dom.Document;
      +import org.w3c.dom.Element;
      +import org.w3c.dom.Node;
      +import org.w3c.dom.NodeList;
      +
      +import com.icesoft.faces.application.D2DViewHandler;
      +import com.icesoft.faces.application.StartupTime;
      +import com.icesoft.faces.context.effects.JavascriptContext;
      +import com.icesoft.faces.util.CoreUtils;
      +import com.icesoft.faces.webapp.http.common.Configuration;
      +import com.icesoft.jasper.Constants;
      +
       /**
        * <p><strong>DOMResponseWriter</strong> is a DOM specific implementation of
        * <code>javax.faces.context.ResponseWriter</code>.
      @@ -184,11 +187,20 @@
                   throws IOException {
               Node oldCursor = cursor;
               Element elem = document.createElement(name);
      - cursor = cursor.appendChild(elem);
               if (log.isTraceEnabled()) {
                   log.trace("startElement() name: " + name + " elem: " + elem +
      - " oldCursor: " + oldCursor + " newCursor: " + cursor);
      + " oldCursor: " + oldCursor);
               }
      + try{
      + cursor = cursor.appendChild(elem);
      + }
      + catch( DOMException de ){
      + log.error("could not write element: " + elem + " oldCursor: " + oldCursor);
      + throw de;
      + }
      + if (log.isTraceEnabled()) {
      + log.trace("startElement() newCursor: " + cursor);
      + }
           }
       
           public void endElement(String name) throws IOException {

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              Philip Breau
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: