ICEfaces
  1. ICEfaces
  2. ICE-8978

UnsupportedOperationException thrown when compressDOM=true

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.2.0.GA
    • Fix Version/s: 3.3
    • Labels:
      None
    • Environment:
      All
    • Assignee Priority:
      P2
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Compatibility/Configuration

      Description

      When compressDOM=true and an ace:ajax event is executed with an ICE component on the page an UnsupportedOperationException is thrown. Changing to compressDOM=false, the error isn't thrown.
      1. Case11816Example.zip
        19 kB
        Arran Mccullough
      2. Case11816ExampleWAR.zip
        9.62 MB
        Arran Mccullough

        Activity

        Hide
        Arran Mccullough added a comment -

        Attached test case that shows the issue. To reproduce enter in some text to the masked entry and tab out. Error is thrown then.

        Show
        Arran Mccullough added a comment - Attached test case that shows the issue. To reproduce enter in some text to the masked entry and tab out. Error is thrown then.
        Hide
        Ted Goddard added a comment -
        
        import com.sun.xml.fastinfoset.dom.DOMDocumentParser;
        import com.sun.xml.fastinfoset.dom.DOMDocumentSerializer;
        import javax.xml.parsers.DocumentBuilder;
        import javax.xml.parsers.DocumentBuilderFactory;
        import javax.xml.parsers.ParserConfigurationException;
        import org.w3c.dom.Document;
        import org.w3c.dom.Element;
        import org.w3c.dom.Node;
        import org.w3c.dom.Attr;
        import java.io.ByteArrayInputStream;
        import java.io.ByteArrayOutputStream;
        
        public class Test  {
        
            public static void main (String[] args)  {
                DocumentBuilder DOCUMENT_BUILDER;
                try {
                    DOCUMENT_BUILDER = DocumentBuilderFactory.newInstance()
                            .newDocumentBuilder();
                    Document document = DOCUMENT_BUILDER.newDocument();
                    Node html = document.createElement("html");
                    document.appendChild(html);
                    Node body = document.createElement("body");
                    html.appendChild(body);
                    Element form = document.createElement("form");
                    body.appendChild(form);
                    Attr attribute = document.createAttribute("id");
                    attribute.setValue("findme");
                    form.setAttributeNode(attribute);
        
                    Element form2 = document.createElement("form");
                    body.appendChild(form2);
                    attribute = document.createAttribute("id");
                    attribute.setValue("findme2");
                    form2.setAttributeNode(attribute);
                    form2.setIdAttributeNode(attribute, true);
        
                    System.out.println("findme " + document.getElementById("findme"));
                    System.out.println("findme2 " + document.getElementById("findme2"));
        
                    System.out.println("\nSerializing through FastInfoset");
        
        
                    DOMDocumentSerializer serializer = new DOMDocumentSerializer();
                    ByteArrayOutputStream out = new ByteArrayOutputStream(10000);
                    serializer.setOutputStream(out);
                    serializer.serialize(document);
        
                    document = DOCUMENT_BUILDER.newDocument();
                    DOMDocumentParser parser = new DOMDocumentParser();
                    ByteArrayInputStream in = new ByteArrayInputStream(
                        out.toByteArray());
                    parser.parse(document, in);
        
                    System.out.println("findme " + document.getElementById("findme"));
                    System.out.println("findme2 " + document.getElementById("findme2"));
        
                } catch (Exception e) {
                   e.printStackTrace(); 
                }
        
            }
        
        }
        
        
        Show
        Ted Goddard added a comment - import com.sun.xml.fastinfoset.dom.DOMDocumentParser; import com.sun.xml.fastinfoset.dom.DOMDocumentSerializer; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.Attr; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; public class Test { public static void main ( String [] args) { DocumentBuilder DOCUMENT_BUILDER; try { DOCUMENT_BUILDER = DocumentBuilderFactory.newInstance() .newDocumentBuilder(); Document document = DOCUMENT_BUILDER.newDocument(); Node html = document.createElement( "html" ); document.appendChild(html); Node body = document.createElement( "body" ); html.appendChild(body); Element form = document.createElement( "form" ); body.appendChild(form); Attr attribute = document.createAttribute( "id" ); attribute.setValue( "findme" ); form.setAttributeNode(attribute); Element form2 = document.createElement( "form" ); body.appendChild(form2); attribute = document.createAttribute( "id" ); attribute.setValue( "findme2" ); form2.setAttributeNode(attribute); form2.setIdAttributeNode(attribute, true ); System .out.println( "findme " + document.getElementById( "findme" )); System .out.println( "findme2 " + document.getElementById( "findme2" )); System .out.println( "\nSerializing through FastInfoset" ); DOMDocumentSerializer serializer = new DOMDocumentSerializer(); ByteArrayOutputStream out = new ByteArrayOutputStream(10000); serializer.setOutputStream(out); serializer.serialize(document); document = DOCUMENT_BUILDER.newDocument(); DOMDocumentParser parser = new DOMDocumentParser(); ByteArrayInputStream in = new ByteArrayInputStream( out.toByteArray()); parser.parse(document, in); System .out.println( "findme " + document.getElementById( "findme" )); System .out.println( "findme2 " + document.getElementById( "findme2" )); } catch (Exception e) { e.printStackTrace(); } } }
        Hide
        Ted Goddard added a comment -

        Simple test case shows that FastInfoset DOMDocumentParser does not cause "id" nodes to be regarded as IDs. It should be possible to integrate FastInfoset implementation into ICEfaces and invoke setIdAttributeNode() for attributes named "id".

        Show
        Ted Goddard added a comment - Simple test case shows that FastInfoset DOMDocumentParser does not cause "id" nodes to be regarded as IDs. It should be possible to integrate FastInfoset implementation into ICEfaces and invoke setIdAttributeNode() for attributes named "id".
        Hide
        Ted Goddard added a comment -

        This looks like it can be fixed, however, I thought the customer had indicated it was no longer necessary? It may be worthwhile fixing in any case given the fundamental nature (without this fix, subtree rendering is incompatible with compressDOM).

        Show
        Ted Goddard added a comment - This looks like it can be fixed, however, I thought the customer had indicated it was no longer necessary? It may be worthwhile fixing in any case given the fundamental nature (without this fix, subtree rendering is incompatible with compressDOM).
        Hide
        Arran Mccullough added a comment -

        Thanks Ted, the customer hasn't responded stating if its a requirement or not. Once I hear back I'll update the case.

        Show
        Arran Mccullough added a comment - Thanks Ted, the customer hasn't responded stating if its a requirement or not. Once I hear back I'll update the case.
        Hide
        Ted Goddard added a comment -

        A fix is checked in, however it has only been verified with the standalone test case. The fix will also be verified with the attached .war file.

        It will no longer be necessary to include FastInfoset.jar with ICEfaces.

        Show
        Ted Goddard added a comment - A fix is checked in, however it has only been verified with the standalone test case. The fix will also be verified with the attached .war file. It will no longer be necessary to include FastInfoset.jar with ICEfaces.
        Hide
        Ted Goddard added a comment -

        Fix verified in attached test case Case11816ExampleWAR.zip.

        Show
        Ted Goddard added a comment - Fix verified in attached test case Case11816ExampleWAR.zip.
        Hide
        Mark Collette added a comment -

        Follow-on commit to remove the Maven dependency of ICEfaces on the fastinfoset jar, since we've repackaged it to be inside icefaces.jar itself. This should affect the next release after ICEfaces 3.3.0, since that's out already.

        icefaces3 trunk
        Subversion 34944

        Show
        Mark Collette added a comment - Follow-on commit to remove the Maven dependency of ICEfaces on the fastinfoset jar, since we've repackaged it to be inside icefaces.jar itself. This should affect the next release after ICEfaces 3.3.0, since that's out already. icefaces3 trunk Subversion 34944

          People

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

            Dates

            • Created:
              Updated:
              Resolved: