ICEfaces
  1. ICEfaces
  2. ICE-4264

DOMException with MyFaces 1.1.5, Jboss 4.2 and ICEfaces

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.2 SP1b, 1.8RC2
    • Fix Version/s: 1.8.1
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      MyFaces 1.1.5, Jboss 4.2.x

      Description

      When attempting to bring up the main page of the attached test app, an exception is thrown in the server logs:

      09:08:25,254 ERROR [[Persistent Faces Servlet]] Servlet.service() for servlet Persistent Faces Servlet threw exception
      java.lang.RuntimeException: Failed to append element[tag: html; attributes: ] into #document
      at com.icesoft.faces.context.DOMResponseWriter.appendToCursor(DOMResponseWriter.java:528)
      at com.icesoft.faces.context.DOMResponseWriter.startElement(DOMResponseWriter.java:169)
      ..............
      Caused by: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.
      at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.insertBefore(CoreDocumentImpl.java:419)

      The attached test case is a very basic web app. It has the required ICEfaces jar and myFaces jars along with this context param which tells jboss that the war bundles the JSF implementation:

      <context-param>
              <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
              <param-value>true</param-value>
      </context-param>



        Activity

        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P1
        Ted Goddard made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ted Goddard made changes -
        Fix Version/s 1.8.1 [ 10170 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #18825 Fri May 01 09:05:13 MDT 2009 ted.goddard successful detection of MyFaces disabled JSF1.2 behaviors (ICE-4264)
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/parser/ImplementationUtil.java
        Hide
        Ted Goddard added a comment -

        Candidate fix is to disable JSF12 detection when MyFaces is detected.

        Index: src/com/icesoft/faces/webapp/parser/ImplementationUtil.java
        ===================================================================
        — src/com/icesoft/faces/webapp/parser/ImplementationUtil.java (revision 18814)
        +++ src/com/icesoft/faces/webapp/parser/ImplementationUtil.java (working copy)
        @@ -111,16 +111,6 @@
        } catch (ClassNotFoundException e) {
        }

        • try { - Class.forName(MYFACES_MARKER); - isMyFaces = true; - }

          catch (ClassNotFoundException e)

          { - }

          -

        • if (log.isTraceEnabled()) { - log.trace("JSF-RI: " + isRI + " MyFaces: " + isMyFaces); - }

          -
          //Test for JSF 1.2
          try

          { Class.forName(JSF12_MARKER); @@ -144,6 +134,18 @@ }

        try

        { + Class.forName(MYFACES_MARKER); + isMyFaces = true; + //Disable JSF12 detection in MyFaces environment + isJSF12 = false; + }

        catch (ClassNotFoundException e)

        { + }

        +
        + if (log.isTraceEnabled())

        { + log.trace("JSF-RI: " + isRI + " MyFaces: " + isMyFaces); + }

        +
        + try {
        javax.faces.component.html.HtmlOutputText comp =
        new javax.faces.component.html.HtmlOutputText();
        isStockAttributeTracking = isAttributeTracking(comp);

        Show
        Ted Goddard added a comment - Candidate fix is to disable JSF12 detection when MyFaces is detected. Index: src/com/icesoft/faces/webapp/parser/ImplementationUtil.java =================================================================== — src/com/icesoft/faces/webapp/parser/ImplementationUtil.java (revision 18814) +++ src/com/icesoft/faces/webapp/parser/ImplementationUtil.java (working copy) @@ -111,16 +111,6 @@ } catch (ClassNotFoundException e) { } try { - Class.forName(MYFACES_MARKER); - isMyFaces = true; - } catch (ClassNotFoundException e) { - } - if (log.isTraceEnabled()) { - log.trace("JSF-RI: " + isRI + " MyFaces: " + isMyFaces); - } - //Test for JSF 1.2 try { Class.forName(JSF12_MARKER); @@ -144,6 +134,18 @@ } try { + Class.forName(MYFACES_MARKER); + isMyFaces = true; + //Disable JSF12 detection in MyFaces environment + isJSF12 = false; + } catch (ClassNotFoundException e) { + } + + if (log.isTraceEnabled()) { + log.trace("JSF-RI: " + isRI + " MyFaces: " + isMyFaces); + } + + try { javax.faces.component.html.HtmlOutputText comp = new javax.faces.component.html.HtmlOutputText(); isStockAttributeTracking = isAttributeTracking(comp);
        Hide
        Ted Goddard added a comment -

        This is caused by the simultaneous presence of both JSF 1.2 and MyFaces 1.1.

        MyFaces has been specified for initialization through the WAR_BUNDLES_JSF_IMPL parameter, but JSF 1.2 is still on the classpath. ICEfaces automatically detects JSF 1.2 and performs certain operations under that assumption. In this case, JSF 1.1 and 1.2 conflict over the role of the View tag: with JSF 1.1, the View tag is responsible for rendering, but with JSF 1.2, the ViewHandler takes this role. When both JSF 1.2 and JSF 1.1 are present, ICEfaces attempts to render the view twice resulting in the exception (the DOMResponseWriter document has been cleared by the termination of the initial render pass, so is null for the redundant pass driven by JSF 1.2 detection).

        Show
        Ted Goddard added a comment - This is caused by the simultaneous presence of both JSF 1.2 and MyFaces 1.1. MyFaces has been specified for initialization through the WAR_BUNDLES_JSF_IMPL parameter, but JSF 1.2 is still on the classpath. ICEfaces automatically detects JSF 1.2 and performs certain operations under that assumption. In this case, JSF 1.1 and 1.2 conflict over the role of the View tag: with JSF 1.1, the View tag is responsible for rendering, but with JSF 1.2, the ViewHandler takes this role. When both JSF 1.2 and JSF 1.1 are present, ICEfaces attempts to render the view twice resulting in the exception (the DOMResponseWriter document has been cleared by the termination of the initial render pass, so is null for the redundant pass driven by JSF 1.2 detection).
        Ken Fyten made changes -
        Assignee Priority P1
        Assignee Ted Goddard [ ted.goddard ]
        Tyler Johnson made changes -
        Attachment TestIcefacesMyfaces.war [ 11634 ]
        Tyler Johnson made changes -
        Attachment TestIcefacesMyfaces.war [ 11628 ]
        Tyler Johnson made changes -
        Attachment TestIcefacesMyfaces.war [ 11628 ]
        Hide
        Tyler Johnson added a comment - - edited

        Sample app demonstrating issue. Uses 1.8 RC2 jars.

        http://localhost:8080/TestIcefacesMyfaces/test.jsp

        The page renders correctly but the exception is thrown in the server logs. I've attempted to add xercesImpl and xml-api but no luck.

        Ty

        Show
        Tyler Johnson added a comment - - edited Sample app demonstrating issue. Uses 1.8 RC2 jars. http://localhost:8080/TestIcefacesMyfaces/test.jsp The page renders correctly but the exception is thrown in the server logs. I've attempted to add xercesImpl and xml-api but no luck. Ty
        Hide
        Tyler Johnson added a comment -

        The DOMException is with 1.7.2 SP1. Here is the beginning of the exception when using 1.8 RC2:

        23:38:44,356 INFO [MainServlet] Adapting to Push environment.
        23:38:46,184 ERROR [[Persistent Faces Servlet]] Servlet.service() for servlet Pe
        rsistent Faces Servlet threw exception
        java.lang.NullPointerException
        at com.icesoft.faces.context.DOMResponseWriter.startElement(DOMResponseW
        riter.java:199)
        at com.icesoft.faces.renderkit.dom_html_basic.XMLRenderer.encodeBegin(XM
        LRenderer.java:51)
        at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.jav
        a:515)
        at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHa
        ndler.java:514)

        Show
        Tyler Johnson added a comment - The DOMException is with 1.7.2 SP1. Here is the beginning of the exception when using 1.8 RC2: 23:38:44,356 INFO [MainServlet] Adapting to Push environment. 23:38:46,184 ERROR [ [Persistent Faces Servlet] ] Servlet.service() for servlet Pe rsistent Faces Servlet threw exception java.lang.NullPointerException at com.icesoft.faces.context.DOMResponseWriter.startElement(DOMResponseW riter.java:199) at com.icesoft.faces.renderkit.dom_html_basic.XMLRenderer.encodeBegin(XM LRenderer.java:51) at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.jav a:515) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHa ndler.java:514)
        Tyler Johnson made changes -
        Field Original Value New Value
        Salesforce Case [50070000008Iz6w]
        Tyler Johnson created issue -

          People

          • Assignee:
            Ted Goddard
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: