ICEfaces
  1. ICEfaces
  2. ICE-5988

ICEfaces2.0 Facelets ui:debug tag causes out-of-memory error with IE6

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0-Beta2
    • Fix Version/s: 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      jsf2.0, ICEfaces-2.0, IE6

      Description

      tested and confirmed with QA that this error does occur. QA to test with just jsf2.0 (no ICEfaces) to see if the issue lies with mojarra.

        Issue Links

          Activity

          Judy Guglielmin created issue -
          Hide
          Judy Guglielmin added a comment -

          can you please confirm whether it occurs without ICEfaces (just jsf2.0)?

          Show
          Judy Guglielmin added a comment - can you please confirm whether it occurs without ICEfaces (just jsf2.0)?
          Judy Guglielmin made changes -
          Field Original Value New Value
          Assignee Mandeep Hayher [ mandeep.hayher ]
          Hide
          Mandeep Hayher added a comment -

          Problem could not be reproduced without icefaces.

          Test-case is available at "repo\qa\trunk\Regression-Icefaces2\ICE-5988".

          Show
          Mandeep Hayher added a comment - Problem could not be reproduced without icefaces. Test-case is available at "repo\qa\trunk\Regression-Icefaces2\ ICE-5988 ".
          Mandeep Hayher made changes -
          Assignee Mandeep Hayher [ mandeep.hayher ] Judy Guglielmin [ judy.guglielmin ]
          Judy Guglielmin made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          Judy Guglielmin added a comment -

          note Mandeep's comments, but looks like a problem with ICEfaces-2 only

          Show
          Judy Guglielmin added a comment - note Mandeep's comments, but looks like a problem with ICEfaces-2 only
          Judy Guglielmin made changes -
          Assignee Judy Guglielmin [ judy.guglielmin ] Ken Fyten [ ken.fyten ]
          Ken Fyten made changes -
          Salesforce Case []
          Fix Version/s 2.0-Beta2 [ 10242 ]
          Assignee Priority P2
          Assignee Ken Fyten [ ken.fyten ] Deryk Sinotte [ deryk.sinotte ]
          Hide
          Deryk Sinotte added a comment -

          I don't have IE6 currently installed but I did try this with Chrome (where it worked) and Firefox (where it had some problems).

          With Firefox, after I entered some text and hit enter, the Firebug console would complain about the update causing too much recursion:

          too much recursion
          //]]>]]><![CDATA[
          main.jsf (line 4)

          The update itself looks something like this and the problem seems to revolve around the extra nested CDATA about 2/3 of the way down. It's easy enough to recreate with Firefox.

          <?xml version='1.0' encoding='UTF-8'?>
          <partial-response><changes><update id="debugPanel"><Unable to render embedded object: File ([CDATA[<span id="debugPanel"><script language="javascript" type="text/javascript">//<) not found.[CDATA[
          function faceletsDebug(URL)

          { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 240,top = 212');"); }

          ;var faceletsOrigKeyup = document.onkeyup; document.onkeyup = function(e)

          { if (window.event) e = window.event; if (String.fromCharCode(e.keyCode) == 'D' & e.shiftKey & e.ctrlKey) faceletsDebug('/ICE-5988/main.jsf?facelets.ui.DebugOutput=1281978479087'); else if (faceletsOrigKeyup) faceletsOrigKeyup(e); }

          ;
          //]]>]]><![CDATA[
          </script></span>]]></update><update id="iceform:output1"><Unable to render embedded object: File (output1">Input: abbbbbb</span>]]></update><update id="javax.faces.ViewState"><) not found.[CDATA[-1425665775163257041:-4653656636132828859]]></update></changes></partial-response>

          Show
          Deryk Sinotte added a comment - I don't have IE6 currently installed but I did try this with Chrome (where it worked) and Firefox (where it had some problems). With Firefox, after I entered some text and hit enter, the Firebug console would complain about the update causing too much recursion: too much recursion //]]>]]><![CDATA[ main.jsf (line 4) The update itself looks something like this and the problem seems to revolve around the extra nested CDATA about 2/3 of the way down. It's easy enough to recreate with Firefox. <?xml version='1.0' encoding='UTF-8'?> <partial-response><changes><update id="debugPanel">< Unable to render embedded object: File ([CDATA[<span id="debugPanel"><script language="javascript" type="text/javascript">//<) not found. [CDATA[ function faceletsDebug(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 240,top = 212');"); } ;var faceletsOrigKeyup = document.onkeyup; document.onkeyup = function(e) { if (window.event) e = window.event; if (String.fromCharCode(e.keyCode) == 'D' & e.shiftKey & e.ctrlKey) faceletsDebug('/ICE-5988/main.jsf?facelets.ui.DebugOutput=1281978479087'); else if (faceletsOrigKeyup) faceletsOrigKeyup(e); } ; //]]>]]><![CDATA[ </script></span>]]></update><update id="iceform:output1">< Unable to render embedded object: File (output1">Input: abbbbbb</span>]]></update><update id="javax.faces.ViewState"><) not found. [CDATA [-1425665775163257041:-4653656636132828859] ]></update></changes></partial-response>
          Hide
          Deryk Sinotte added a comment -

          A screenshot of Firefox + Firebug showing the problem of too much recursion when UIDebug is being rendered.

          Show
          Deryk Sinotte added a comment - A screenshot of Firefox + Firebug showing the problem of too much recursion when UIDebug is being rendered.
          Deryk Sinotte made changes -
          Attachment too much recursion.png [ 12497 ]
          Hide
          Deryk Sinotte added a comment -

          Still testing but it looks like the update to the UIDebug component is a little haywire for some reason. We did do some work to wrap this in a span (http://jira.icefaces.org/browse/ICE-5717) to help facilitate updates but maybe there's something not working quite right with that.

          Show
          Deryk Sinotte added a comment - Still testing but it looks like the update to the UIDebug component is a little haywire for some reason. We did do some work to wrap this in a span ( http://jira.icefaces.org/browse/ICE-5717 ) to help facilitate updates but maybe there's something not working quite right with that.
          Hide
          Deryk Sinotte added a comment -

          Looks to me like the issue is related to some CDATA massaging that we do in DomUtils.printNode() - specifically:

          case Node.TEXT_NODE:
          if (!isInCdata)

          { writer.write(node.getNodeValue()); }

          else

          { String value = node.getNodeValue(); String escaped = CDATA_END.matcher(value) .replaceAll("]]>]]><![CDATA["); writer.write(escaped); }

          break;

          I'm not sure that the replaceAll section is supposed to accomplish in our own code but with the script that's generated by the UIDebug component, it causing then end of the script be changed from:

          ; else if (faceletsOrigKeyup) faceletsOrigKeyup(e); };
          //]]>

          to

          ; else if (faceletsOrigKeyup) faceletsOrigKeyup(e); };
          //]]>]]><![CDATA[

          which leads to the JavaScript processor to complain. They likely all complain in different ways - IE6 doesn't handle it well and just recurses right out of memory.

          Show
          Deryk Sinotte added a comment - Looks to me like the issue is related to some CDATA massaging that we do in DomUtils.printNode() - specifically: case Node.TEXT_NODE: if (!isInCdata) { writer.write(node.getNodeValue()); } else { String value = node.getNodeValue(); String escaped = CDATA_END.matcher(value) .replaceAll("]]>]]><![CDATA["); writer.write(escaped); } break; I'm not sure that the replaceAll section is supposed to accomplish in our own code but with the script that's generated by the UIDebug component, it causing then end of the script be changed from: ; else if (faceletsOrigKeyup) faceletsOrigKeyup(e); }; //]]> to ; else if (faceletsOrigKeyup) faceletsOrigKeyup(e); }; //]]>]]><![CDATA[ which leads to the JavaScript processor to complain. They likely all complain in different ways - IE6 doesn't handle it well and just recurses right out of memory.
          Hide
          Ted Goddard added a comment -

          "Massaging" introduced in this JIRA:

          http://jira.icefaces.org/browse/ICE-5742

          The fix was specifically for ui:debug (and verified at that time) , so perhaps it is being exercised under different conditions.

          Show
          Ted Goddard added a comment - "Massaging" introduced in this JIRA: http://jira.icefaces.org/browse/ICE-5742 The fix was specifically for ui:debug (and verified at that time) , so perhaps it is being exercised under different conditions.
          Hide
          Ted Goddard added a comment -

          Removing the printNode ]]> escaping code results in the original XML parsing errors seen in ICE-5472. This indicates that the fix is working correctly (well-formed XML is being generated even when CDATA sections are included in the HTML), however some other code in jsf.js may not be reacting correctly.

          Show
          Ted Goddard added a comment - Removing the printNode ]]> escaping code results in the original XML parsing errors seen in ICE-5472. This indicates that the fix is working correctly (well-formed XML is being generated even when CDATA sections are included in the HTML), however some other code in jsf.js may not be reacting correctly.
          Ted Goddard made changes -
          Assignee Deryk Sinotte [ deryk.sinotte ] Ted Goddard [ ted.goddard ]
          Hide
          Ted Goddard added a comment -

          Issue still present with mojarra jsf-api-2.0.4-b03.jar jsf-impl-2.0.4-b03.jar.

          Show
          Ted Goddard added a comment - Issue still present with mojarra jsf-api-2.0.4-b03.jar jsf-impl-2.0.4-b03.jar.
          Hide
          Ted Goddard added a comment -

          This appears to be a bug in the the Facelet debug JavaScript – it does not allow itself to be registered multiple times:

          Extracting the relevant parts:

          var faceletsOrigKeyup = document.onkeyup;
          document.onkeyup = function(e)

          { ... if (faceletsOrigKeyup) faceletsOrigKeyup(e); ... }

          ;

          Removing

          else if (faceletsOrigKeyup) faceletsOrigKeyup(e);

          disables the onKeyUp chain recursion, however, also destroys any third party onKeyUp behavior.

          Show
          Ted Goddard added a comment - This appears to be a bug in the the Facelet debug JavaScript – it does not allow itself to be registered multiple times: Extracting the relevant parts: var faceletsOrigKeyup = document.onkeyup; document.onkeyup = function(e) { ... if (faceletsOrigKeyup) faceletsOrigKeyup(e); ... } ; Removing else if (faceletsOrigKeyup) faceletsOrigKeyup(e); disables the onKeyUp chain recursion, however, also destroys any third party onKeyUp behavior.
          Hide
          Ted Goddard added a comment -

          Placing ui:debug in the HEAD does not serve as a workaround – the contents of the script are updated each time (facelets.ui.DebugOutput=1281978479087) resulting in an update to the node and recursive addition of the script. Perhaps ui:debug can be modified to be included in jsf.js and search the document (or suitable container) for the ViewState key. Note that ui:debug will not work correctly in the Portlet case due to the global registration of the DebugOutput ID.

          Show
          Ted Goddard added a comment - Placing ui:debug in the HEAD does not serve as a workaround – the contents of the script are updated each time (facelets.ui.DebugOutput=1281978479087) resulting in an update to the node and recursive addition of the script. Perhaps ui:debug can be modified to be included in jsf.js and search the document (or suitable container) for the ViewState key. Note that ui:debug will not work correctly in the Portlet case due to the global registration of the DebugOutput ID.
          Hide
          Ted Goddard added a comment -

          One short-term solution for mojarra would be to not register a new onKeyUp handler if a debug handler is already registered (also stored in a global variable). However, this would not address the Portlet case, where the debug element should probably add onKeyUp to just the parent container.

          Assigning to Mircea for comment and suggestions (I'm not sure whether the mojarra would will be most interested in a short-term fix or a Portlet solution). It should be possible to reproduce this bug in mojarra by altering the test case to always update the element containing the ui:debug via Ajax.

          Show
          Ted Goddard added a comment - One short-term solution for mojarra would be to not register a new onKeyUp handler if a debug handler is already registered (also stored in a global variable). However, this would not address the Portlet case, where the debug element should probably add onKeyUp to just the parent container. Assigning to Mircea for comment and suggestions (I'm not sure whether the mojarra would will be most interested in a short-term fix or a Portlet solution). It should be possible to reproduce this bug in mojarra by altering the test case to always update the element containing the ui:debug via Ajax.
          Ted Goddard made changes -
          Assignee Ted Goddard [ ted.goddard ] Mircea Toma [ mircea.toma ]
          Ken Fyten made changes -
          Salesforce Case []
          Assignee Mircea Toma [ mircea.toma ] Ted Goddard [ ted.goddard ]
          Ken Fyten made changes -
          Salesforce Case []
          Affects [Documentation (User Guide, Ref. Guide, etc.), Compatibility/Configuration]
          Hide
          Deryk Sinotte added a comment -

          Re-assigning to Mircea for re-evaluation of the synchronized Ajax request on disposal before the final release.

          Show
          Deryk Sinotte added a comment - Re-assigning to Mircea for re-evaluation of the synchronized Ajax request on disposal before the final release.
          Deryk Sinotte made changes -
          Salesforce Case []
          Fix Version/s 2.0.0 [ 10230 ]
          Fix Version/s 2.0-Beta2 [ 10242 ]
          Assignee Priority P2 P1
          Assignee Ted Goddard [ ted.goddard ] Mircea Toma [ mircea.toma ]
          Hide
          Mircea Toma added a comment -

          Created test case that replicates the issue in JSF only environment (no ICEfaces). Created issue in Mojarra's bug tracking system: https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1855 . Attached the test case to the issue.

          Show
          Mircea Toma added a comment - Created test case that replicates the issue in JSF only environment (no ICEfaces). Created issue in Mojarra's bug tracking system: https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1855 . Attached the test case to the issue.
          Mircea Toma made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Priority P1
          Brad Kroeger made changes -
          Link This issue is duplicated by ICE-6455 [ ICE-6455 ]
          Hide
          Ken Fyten added a comment -

          In lieu of waiting for Mojarra to fix this issue someday, we could also create a replacement ui:debug feature for ICEfaces.

          Show
          Ken Fyten added a comment - In lieu of waiting for Mojarra to fix this issue someday, we could also create a replacement ui:debug feature for ICEfaces.
          Ken Fyten made changes -
          Link This issue depends on ICE-6556 [ ICE-6556 ]
          Ken Fyten made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Hide
          Ken Fyten added a comment -

          Waiting for Mojarra fix.

          Show
          Ken Fyten added a comment - Waiting for Mojarra fix.
          Ken Fyten made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Won't Fix [ 2 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Mircea Toma
              Reporter:
              Judy Guglielmin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: