ICEfaces
  1. ICEfaces
  2. ICE-6094

Mojarra JSF 2.0.4-b03: certain tests fail with java.lang.classCastException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Beta2
    • Fix Version/s: 2.0-Beta2, 2.0.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Icefaces2 trunk revision# 22552
      Server: Tomcat6
      Browser: FF3.6
      Mojarra JSF 2.0.4-b03
      The jsf jars for this can be found in ossrepo/icefaces2/trunk/icefaces/lib/portlets/

      Description

      Following regression tests fail with java.lang.classCastException:
      ICE-2753, ICE-2953, ICE-3041, ICE-3046, ICE-3807

      java.lang.classCastException is also see on component-showcase Tree component.

        Activity

        Hide
        Ken Fyten added a comment -

        Note that these failures are consistent between Mojarra JSF 2.0.4-b03 and also JSF 2.1 Sept. 3 SNAPSHOT.

        Show
        Ken Fyten added a comment - Note that these failures are consistent between Mojarra JSF 2.0.4-b03 and also JSF 2.1 Sept. 3 SNAPSHOT.
        Hide
        Ted Goddard added a comment -

        Instrumentation added to mojarra 2.0.4 shows:

        saveState class com.icesoft.faces.component.ext.HtmlOutputText iceform:j_idt175 [Ljava.lang.Object;@3347a591
        saveState class com.icesoft.faces.component.ext.HtmlPanelGroup iceform:j_idt176 [Ljava.lang.Object;@24c6ece4
        saveState class com.icesoft.faces.component.tree.Tree iceform:tree [Ljava.lang.Object;@7fea7f98
        !D! saveState class com.icesoft.faces.component.tree.TreeNode iceform:tree:n-2-3 com.sun.faces.application.view.StateHolderSaver@7c5f15c3
        !D! saveState class com.icesoft.faces.component.ext.HtmlPanelGroup iceform:tree:n-2-3:j_idt180 com.sun.faces.application.view.StateHolderSaver@468df4ff
        !D! saveState class com.icesoft.faces.component.ext.HtmlCommandLink iceform:tree:n-2-3:j_idt181 com.sun.faces.application.view.StateHolderSaver@11cfb589
        !D! saveState class javax.faces.component.UIParameter iceform:tree:n-2-3:j_idt182 com.sun.faces.application.view.StateHolderSaver@5b973e81
        !D! saveState class com.icesoft.faces.component.ext.HtmlOutputText iceform:tree:n-2-3:TreeNode com.sun.faces.application.view.StateHolderSaver@2688b621
        !D! saveState class com.icesoft.faces.component.ext.HtmlPanelGroup iceform:tree:n-2-3:j_idt178 com.sun.faces.application.view.StateHolderSaver@596d444a
        !D! saveState class com.icesoft.faces.component.ext.HtmlGraphicImage iceform:tree:n-2-3:j_idt179 com.sun.faces.application.view.StateHolderSaver@149e8424
        saveState class com.icesoft.faces.component.ext.HtmlCommandButton iceform:moveUp [Ljava.lang.Object;@32f5620f
        saveState class com.icesoft.faces.component.ext.HtmlCommandButton iceform:moveDown [Ljava.lang.Object;@bf8e0ec

        Indicating that mojarra is classifying the tree subnodes as dynamic components for some reason.

        Show
        Ted Goddard added a comment - Instrumentation added to mojarra 2.0.4 shows: saveState class com.icesoft.faces.component.ext.HtmlOutputText iceform:j_idt175 [Ljava.lang.Object;@3347a591 saveState class com.icesoft.faces.component.ext.HtmlPanelGroup iceform:j_idt176 [Ljava.lang.Object;@24c6ece4 saveState class com.icesoft.faces.component.tree.Tree iceform:tree [Ljava.lang.Object;@7fea7f98 !D! saveState class com.icesoft.faces.component.tree.TreeNode iceform:tree:n-2-3 com.sun.faces.application.view.StateHolderSaver@7c5f15c3 !D! saveState class com.icesoft.faces.component.ext.HtmlPanelGroup iceform:tree:n-2-3:j_idt180 com.sun.faces.application.view.StateHolderSaver@468df4ff !D! saveState class com.icesoft.faces.component.ext.HtmlCommandLink iceform:tree:n-2-3:j_idt181 com.sun.faces.application.view.StateHolderSaver@11cfb589 !D! saveState class javax.faces.component.UIParameter iceform:tree:n-2-3:j_idt182 com.sun.faces.application.view.StateHolderSaver@5b973e81 !D! saveState class com.icesoft.faces.component.ext.HtmlOutputText iceform:tree:n-2-3:TreeNode com.sun.faces.application.view.StateHolderSaver@2688b621 !D! saveState class com.icesoft.faces.component.ext.HtmlPanelGroup iceform:tree:n-2-3:j_idt178 com.sun.faces.application.view.StateHolderSaver@596d444a !D! saveState class com.icesoft.faces.component.ext.HtmlGraphicImage iceform:tree:n-2-3:j_idt179 com.sun.faces.application.view.StateHolderSaver@149e8424 saveState class com.icesoft.faces.component.ext.HtmlCommandButton iceform:moveUp [Ljava.lang.Object;@32f5620f saveState class com.icesoft.faces.component.ext.HtmlCommandButton iceform:moveDown [Ljava.lang.Object;@bf8e0ec Indicating that mojarra is classifying the tree subnodes as dynamic components for some reason.
        Hide
        Ted Goddard added a comment -


        Additional instrumentation shows that StateContext.handleAddEvent() is specifically invoked for tree subcomponents.

        Show
        Ted Goddard added a comment - Additional instrumentation shows that StateContext.handleAddEvent() is specifically invoked for tree subcomponents.
        Hide
        Ted Goddard added a comment -

        Partial stack trace showing code that triggers "dynamic" classification:

        at javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1751)
        at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:404)
        at com.icesoft.faces.component.tree.Tree.visitTreeNodes(Tree.java:1468)
        at com.icesoft.faces.component.tree.Tree.visitRows(Tree.java:1448)
        at com.icesoft.faces.component.tree.Tree.visitTree(Tree.java:1403)

        Show
        Ted Goddard added a comment - Partial stack trace showing code that triggers "dynamic" classification: at javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1751) at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:404) at com.icesoft.faces.component.tree.Tree.visitTreeNodes(Tree.java:1468) at com.icesoft.faces.component.tree.Tree.visitRows(Tree.java:1448) at com.icesoft.faces.component.tree.Tree.visitTree(Tree.java:1403)
        Hide
        Ted Goddard added a comment -

        Several calls to UIComponent.setParent() are found in Tree and TreeRenderer. The purpose of these calls is not yet clear. Typically a component would not change the parent status during rendering.

        Show
        Ted Goddard added a comment - Several calls to UIComponent.setParent() are found in Tree and TreeRenderer. The purpose of these calls is not yet clear. Typically a component would not change the parent status during rendering.
        Hide
        Ted Goddard added a comment -

        Removing these setParent calls fixes component-showcase with no other apparent ill effects.

        Show
        Ted Goddard added a comment - Removing these setParent calls fixes component-showcase with no other apparent ill effects.
        Hide
        Ted Goddard added a comment -

        Fix checked in:

        ===================================================================
        — compat/components/src/main/java/com/icesoft/faces/component/tree/Tree.java (revision 22563)
        +++ compat/components/src/main/java/com/icesoft/faces/component/tree/Tree.java (working copy)
        @@ -965,7 +965,6 @@
        .getRoot());
        treeNodeTemplate.setMutable(currentNode);
        treeNodeTemplate.setId(ID_PREFIX + pathToCurrentNode);

        • treeNodeTemplate.setParent(this);

        this.setNodePath(pathToCurrentNode);

        @@ -1465,7 +1464,6 @@
        .getRoot());
        treeNodeTemplate.setMutable(currentNode);
        treeNodeTemplate.setId(ID_PREFIX + pathToCurrentNode);

        • treeNodeTemplate.setParent(this);

        this.setNodePath(pathToCurrentNode);

        Index: compat/components/src/main/java/com/icesoft/faces/component/tree/TreeRenderer.java
        ===================================================================
        — compat/components/src/main/java/com/icesoft/faces/component/tree/TreeRenderer.java (revision 22563)
        +++ compat/components/src/main/java/com/icesoft/faces/component/tree/TreeRenderer.java (working copy)
        @@ -338,7 +338,6 @@

        treeNode.setMutable(currentNode);
        treeNode.setId(Tree.ID_PREFIX + pathToCurrentRoot);

        • treeNode.setParent(treeComponent);
          treeComponent.setNodePath(pathToCurrentNode);

        // efficiency and simplicity

        Show
        Ted Goddard added a comment - Fix checked in: =================================================================== — compat/components/src/main/java/com/icesoft/faces/component/tree/Tree.java (revision 22563) +++ compat/components/src/main/java/com/icesoft/faces/component/tree/Tree.java (working copy) @@ -965,7 +965,6 @@ .getRoot()); treeNodeTemplate.setMutable(currentNode); treeNodeTemplate.setId(ID_PREFIX + pathToCurrentNode); treeNodeTemplate.setParent(this); this.setNodePath(pathToCurrentNode); @@ -1465,7 +1464,6 @@ .getRoot()); treeNodeTemplate.setMutable(currentNode); treeNodeTemplate.setId(ID_PREFIX + pathToCurrentNode); treeNodeTemplate.setParent(this); this.setNodePath(pathToCurrentNode); Index: compat/components/src/main/java/com/icesoft/faces/component/tree/TreeRenderer.java =================================================================== — compat/components/src/main/java/com/icesoft/faces/component/tree/TreeRenderer.java (revision 22563) +++ compat/components/src/main/java/com/icesoft/faces/component/tree/TreeRenderer.java (working copy) @@ -338,7 +338,6 @@ treeNode.setMutable(currentNode); treeNode.setId(Tree.ID_PREFIX + pathToCurrentRoot); treeNode.setParent(treeComponent); treeComponent.setNodePath(pathToCurrentNode); // efficiency and simplicity
        Hide
        Ted Goddard added a comment -

        Assigning to Ken for component team review.

        Show
        Ted Goddard added a comment - Assigning to Ken for component team review.
        Hide
        Mark Collette added a comment -

        From reviewing the code, we should be able to just remove the setParent call.

        Show
        Mark Collette added a comment - From reviewing the code, we should be able to just remove the setParent call.

          People

          • Assignee:
            Ken Fyten
            Reporter:
            Mandeep Hayher
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: