ICEfaces
  1. ICEfaces
  2. ICE-5759

ICEfaces 2.0 compressDOM support

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha2
    • Fix Version/s: 2.0-Beta1, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces, Google App Engine
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Compatibility/Configuration

      Description

      The FastInfoset compressDOM feature appears necessary to address Classloader bugs in Google App Engine. Additionally it is useful for reducing the memory use of general ICEfaces applications.

        Activity

        Ted Goddard created issue -
        Ted Goddard made changes -
        Field Original Value New Value
        Salesforce Case []
        Fix Version/s 2.0-Beta [ 10231 ]
        Assignee Ted Goddard [ ted.goddard ]
        Ken Fyten made changes -
        Summary ICEfaces 2.0 compressDOM ICEfaces 2.0 compressDOM support
        Issue Type Bug [ 1 ] New Feature [ 2 ]
        Salesforce Case []
        Affects [Documentation (User Guide, Ref. Guide, etc.), Compatibility/Configuration]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #21586 Tue Jun 01 09:01:16 MDT 2010 ted.goddard compressDOM (ICE-5759)
        Files Changed
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/context/DOMResponseWriter.java
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/util/EnvUtils.java
        Commit graph ADD /icefaces/scratchpads/glimmer/lib/FastInfoset.jar
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/util/EnvConfig.java
        Hide
        Ted Goddard added a comment -

        This is enabled application-wide with the following parameter:

        <context-param>
        <param-name>org.icefaces.compressDOM</param-name>
        <param-value>true</param-value>
        </context-param>

        You should see on startup:

        INFO: ICEfaces init parameter org.icefaces.compressDOM set to true

        It would be possible to allow this to be configurable per-view. The question is whether that would be useful.

        Show
        Ted Goddard added a comment - This is enabled application-wide with the following parameter: <context-param> <param-name>org.icefaces.compressDOM</param-name> <param-value>true</param-value> </context-param> You should see on startup: INFO: ICEfaces init parameter org.icefaces.compressDOM set to true It would be possible to allow this to be configurable per-view. The question is whether that would be useful.
        Hide
        Ted Goddard added a comment -

        compressDOM verified working on Google App Engine.

        Show
        Ted Goddard added a comment - compressDOM verified working on Google App Engine.
        Ted Goddard made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Mandeep Hayher added a comment - - edited

        Nullpointer Exception is seen when user tries to interact with the compat component-showcase on Tomcat6 server. Please see attached screenshot.

        Jun 2, 2010 10:47:10 AM org.icefaces.context.DOMResponseWriter getOldDocument
        SEVERE: Failed to restore old DOM
        org.jvnet.fastinfoset.FastInfosetException: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces. atcom.sun.xml.fastinfoset.dom.DOMDocumentParser.parse(DOMDocumentParser.java:121)

        Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
        at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(AttrNSImpl.java:105)

        SEVERE: Error Rendering View[/showcase.xhtml]
        java.lang.NullPointerException
        at org.icefaces.util.DOMUtils.compareNodes(DOMUtils.java:337)

        Show
        Mandeep Hayher added a comment - - edited Nullpointer Exception is seen when user tries to interact with the compat component-showcase on Tomcat6 server. Please see attached screenshot. Jun 2, 2010 10:47:10 AM org.icefaces.context.DOMResponseWriter getOldDocument SEVERE: Failed to restore old DOM org.jvnet.fastinfoset.FastInfosetException: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces. atcom.sun.xml.fastinfoset.dom.DOMDocumentParser.parse(DOMDocumentParser.java:121) Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces. at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(AttrNSImpl.java:105) SEVERE: Error Rendering View [/showcase.xhtml] java.lang.NullPointerException at org.icefaces.util.DOMUtils.compareNodes(DOMUtils.java:337)
        Mandeep Hayher made changes -
        Attachment screenshot-1.jpg [ 12387 ]
        Hide
        Mandeep Hayher added a comment -

        compat auctionMonitor although the scripts work following exception is seen on the server several time:

        SEVERE: Servlet.service() for servlet Faces Servlet threw exception
        java.lang.NullPointerException
        at java.io.Writer.write(Writer.java:140)
        at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:200)

        Show
        Mandeep Hayher added a comment - compat auctionMonitor although the scripts work following exception is seen on the server several time: SEVERE: Servlet.service() for servlet Faces Servlet threw exception java.lang.NullPointerException at java.io.Writer.write(Writer.java:140) at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:200)
        Hide
        Mandeep Hayher added a comment -

        Cannot load auction application on Tomcat6 server, Following seen on the browser:

        exception

        javax.servlet.ServletException: com/sun/xml/fastinfoset/dom/DOMDocumentSerializer
        javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)

        root cause

        java.lang.NoClassDefFoundError: com/sun/xml/fastinfoset/dom/DOMDocumentSerializer
        org.icefaces.context.DOMResponseWriter.saveOldDocument(DOMResponseWriter.java:563)
        org.icefaces.context.DOMResponseWriter.endDocument(DOMResponseWriter.java:247)
        com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:388)
        com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
        com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
        com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
        javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)

        Show
        Mandeep Hayher added a comment - Cannot load auction application on Tomcat6 server, Following seen on the browser: exception javax.servlet.ServletException: com/sun/xml/fastinfoset/dom/DOMDocumentSerializer javax.faces.webapp.FacesServlet.service(FacesServlet.java:325) root cause java.lang.NoClassDefFoundError: com/sun/xml/fastinfoset/dom/DOMDocumentSerializer org.icefaces.context.DOMResponseWriter.saveOldDocument(DOMResponseWriter.java:563) org.icefaces.context.DOMResponseWriter.endDocument(DOMResponseWriter.java:247) com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:388) com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126) com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
        Hide
        Ted Goddard added a comment -

        When compressDOM is tested, FastInfoset.jar needs to be included in WEB-INF/lib. Please retest auction with the .jar file added.

        Show
        Ted Goddard added a comment - When compressDOM is tested, FastInfoset.jar needs to be included in WEB-INF/lib. Please retest auction with the .jar file added.
        Hide
        Ted Goddard added a comment -

        The org.w3c.dom.DOMException: NAMESPACE_ERR is caused by the presences of namespaces in the DOM. I will investigate whether the FastInfoset Parser/Serializer can be configured to be namespace-aware. If not, it will be necessary to remove namespaces from the source document or implement a pre-processor that strips namespaces from the DOM before applying compression.

        Show
        Ted Goddard added a comment - The org.w3c.dom.DOMException: NAMESPACE_ERR is caused by the presences of namespaces in the DOM. I will investigate whether the FastInfoset Parser/Serializer can be configured to be namespace-aware. If not, it will be necessary to remove namespaces from the source document or implement a pre-processor that strips namespaces from the DOM before applying compression.
        Hide
        Ted Goddard added a comment -

        Enabling namespaceAware on the DocumentBuilder does not seem to be working, but the following setting appears to work:

        doc.setStrictErrorChecking(false);

        Show
        Ted Goddard added a comment - Enabling namespaceAware on the DocumentBuilder does not seem to be working, but the following setting appears to work: doc.setStrictErrorChecking(false);
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #21638 Thu Jun 03 09:54:08 MDT 2010 ted.goddard disable error checking for compressDOM, upgrade to FastInfoset 1.2.8 (ICE-5759)
        Files Changed
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/context/DOMResponseWriter.java
        Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/samples/component-showcase/web/WEB-INF/includes/templates/page-template.xhtml
        Commit graph MODIFY /icefaces/scratchpads/glimmer/lib/FastInfoset.jar
        Hide
        Ted Goddard added a comment -

        FastInfoset is already using namespaceAware APIs, the difficulty arises from the very strict behavior of Document.createAttributeNS():

        NAMESPACE_ERR: Raised if the qualifiedName is a malformed qualified name, if the qualifiedName has a prefix and the namespaceURI is null, if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from " http://www.w3.org/XML/1998/namespace", if the qualifiedName or its prefix is "xmlns" and the namespaceURI is different from "http://www.w3.org/2000/xmlns/", or if the namespaceURI is "http://www.w3.org/2000/xmlns/" and neither the qualifiedName nor its prefix is "xmlns".

        It could be argued that not passing "http://www.w3.org/2000/xmlns/" for the namespaceURI for "xmlns" is a bug in the FastInfoset implementation, but this is not the only case where namespaces might be used without following the rules strictly. The solution is to disable error checking during FastInfoset compression (which will also improve performance). If strict DOM correctness is desired, this can be added as a later feature that specifically enables error checking.

        Show
        Ted Goddard added a comment - FastInfoset is already using namespaceAware APIs, the difficulty arises from the very strict behavior of Document.createAttributeNS(): NAMESPACE_ERR: Raised if the qualifiedName is a malformed qualified name, if the qualifiedName has a prefix and the namespaceURI is null, if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from " http://www.w3.org/XML/1998/namespace ", if the qualifiedName or its prefix is "xmlns" and the namespaceURI is different from "http://www.w3.org/2000/xmlns/", or if the namespaceURI is "http://www.w3.org/2000/xmlns/" and neither the qualifiedName nor its prefix is "xmlns". It could be argued that not passing "http://www.w3.org/2000/xmlns/" for the namespaceURI for "xmlns" is a bug in the FastInfoset implementation, but this is not the only case where namespaces might be used without following the rules strictly. The solution is to disable error checking during FastInfoset compression (which will also improve performance). If strict DOM correctness is desired, this can be added as a later feature that specifically enables error checking.
        Hide
        Mandeep Hayher added a comment -

        Server:Tomcat6
        Browser: FF3.6

        Compat Component-showcase: scripts ran successfully but following error was seen on the server console:

        SEVERE: Error Rendering View[/showcase.xhtml]
        java.lang.NullPointerException
        at org.icefaces.event.WindowAndViewIDSetup$1.encode(WindowAndViewIDSetup.java:52)
        at org.icefaces.event.UIOutputWriter.encodeBegin(UIOutputWriter.java:32)

        Compat AuctionMonitor: test scripts ran successfully but following error seen on the server console:

        SEVERE: Error Rendering View[/auctionMonitor.xhtml]
        java.lang.NullPointerException
        at org.icefaces.event.WindowAndViewIDSetup$1.encode(WindowAndViewIDSetup.java:52)

        java.lang.NullPointerException
        at org.icefaces.event.WindowAndViewIDSetup$1.encode(WindowAndViewIDSetup.java:52)
        at org.icefaces.event.UIOutputWriter.encodeBegin(UIOutputWriter.java:32)

        Auction: still cannot load the application, Still seeing error on the browser:
        java.lang.NoClassDefFoundError: com/sun/xml/fastinfoset/dom/DOMDocumentSerializer

        Show
        Mandeep Hayher added a comment - Server:Tomcat6 Browser: FF3.6 Compat Component-showcase: scripts ran successfully but following error was seen on the server console: SEVERE: Error Rendering View [/showcase.xhtml] java.lang.NullPointerException at org.icefaces.event.WindowAndViewIDSetup$1.encode(WindowAndViewIDSetup.java:52) at org.icefaces.event.UIOutputWriter.encodeBegin(UIOutputWriter.java:32) Compat AuctionMonitor: test scripts ran successfully but following error seen on the server console: SEVERE: Error Rendering View [/auctionMonitor.xhtml] java.lang.NullPointerException at org.icefaces.event.WindowAndViewIDSetup$1.encode(WindowAndViewIDSetup.java:52) java.lang.NullPointerException at org.icefaces.event.WindowAndViewIDSetup$1.encode(WindowAndViewIDSetup.java:52) at org.icefaces.event.UIOutputWriter.encodeBegin(UIOutputWriter.java:32) Auction: still cannot load the application, Still seeing error on the browser: java.lang.NoClassDefFoundError: com/sun/xml/fastinfoset/dom/DOMDocumentSerializer
        Hide
        Ted Goddard added a comment -

        auction appears to be missing FastInfoset.jar, so please ensure that the .jar is present in auction.war.

        The NullPointerException will require further investigation.

        Show
        Ted Goddard added a comment - auction appears to be missing FastInfoset.jar, so please ensure that the .jar is present in auction.war. The NullPointerException will require further investigation.
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Assignee Priority P1
        Hide
        Mandeep Hayher added a comment -

        Glimmer revison# 21717
        Server: Tomcat6
        Browser: FF3.6

        Tested by manually placing FastInfoset.jar in lib folder.
        Auction: all pass
        Basic: all pass
        ElementUpdate: all pass
        Fajax: all pass
        Scopes: Window Scope test failes. counter is reset when user revisited the page. Rest pass.

        Show
        Mandeep Hayher added a comment - Glimmer revison# 21717 Server: Tomcat6 Browser: FF3.6 Tested by manually placing FastInfoset.jar in lib folder. Auction: all pass Basic: all pass ElementUpdate: all pass Fajax: all pass Scopes: Window Scope test failes. counter is reset when user revisited the page. Rest pass.
        Hide
        Ken Fyten added a comment -

        QA confirms that the Window Scope test issue is not related to the compressDOM setting. Fixed!

        Show
        Ken Fyten added a comment - QA confirms that the Window Scope test issue is not related to the compressDOM setting. Fixed!
        Ken Fyten made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Assignee Priority P1
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 2.0.0 [ 10230 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: