ICEfaces
  1. ICEfaces
  2. ICE-9590

ace:dataTable > Changing rendered on group conditional row causes NPE when using binding

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.3.0.GA_P01, 4.0.BETA
    • Fix Version/s: EE-3.3.0.GA_P02, 4.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ICEfaces3 trunk revision# 37857
      EE-3.3.0.GA Maintenance Branch, Icefaces 4 trunk.
      Tomcat7
    • Assignee Priority:
      P3

      Description

      Changing the rendered attribute on an ace:row with a group condition causes a NullPointerException. This doesn't occur when using interval or predicate conditions.

      SEVERE: java.lang.NullPointerException
      at org.icefaces.ace.component.row.Row$GroupPredicate.evaluate(Row.java:104)
      at org.icefaces.ace.component.row.Row.evaluateCondition(Row.java:70)
      at org.icefaces.ace.component.datatable.DataTable.getConditionalRows(DataTable.java:1087)
      at org.icefaces.ace.component.datatable.DataTableRowRenderer.encodeRow(DataTableRowRenderer.java:62)
      at org.icefaces.ace.component.datatable.DataTableRenderer.encodeTableBody(DataTableRenderer.java:293)
      at org.icefaces.ace.component.datatable.DataTableRenderer.encodeTable(DataTableRenderer.java:243)
      at org.icefaces.ace.component.datatable.DataTableRenderer.encodeEntirety(DataTableRenderer.java:170)
      at org.icefaces.ace.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:120)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:877)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1826)
      at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
      at org.icefaces.impl.renderkit.RendererWrapper.encodeChildren(RendererWrapper.java:49)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:847)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1819)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1822)
      at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:150)
      at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:973)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1819)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:421)
      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)


      To reproduce:
      1) Deploy test app located at: http://server.ice:8888/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/Nightly/dataTable
      2) Navigate to 'Conditional Row Test'
      3) Click one of the checkboxes that are marked 'Group' to render the row (exception will occur).
      The exception occurs each time the rendered value is change regardless if it is true or false, but only occurs when using a binding on the dataTable.

        Activity

        Hide
        Carmen Cristurean added a comment -

        Issue reproduced also with IF4 trunk rev# 39869.

        Show
        Carmen Cristurean added a comment - Issue reproduced also with IF4 trunk rev# 39869.
        Hide
        Liana Munroe added a comment -

        Also present on ee.3.3.0.GA maintenance branch.

        Show
        Liana Munroe added a comment - Also present on ee.3.3.0.GA maintenance branch.
        Hide
        Arturo Zambrano added a comment -

        Committed fix to 4.0 trunk at revision 40845 and to 3.3 EE maintenance branch at revision 40846. The problem was that the Row object needed to use methods from the table and for that it needed to find its parent table, and when using binding, it seems like the table instance is not in the component tree at render time, so it's not possible to find it. The fix consists in changing the method signature to pass the data table instance when calling Row.evaluateCondition(), in order to avoid having to find the table.

        Show
        Arturo Zambrano added a comment - Committed fix to 4.0 trunk at revision 40845 and to 3.3 EE maintenance branch at revision 40846. The problem was that the Row object needed to use methods from the table and for that it needed to find its parent table, and when using binding, it seems like the table instance is not in the component tree at render time, so it's not possible to find it. The fix consists in changing the method signature to pass the data table instance when calling Row.evaluateCondition(), in order to avoid having to find the table.
        Hide
        Liana Munroe added a comment -

        An Illegal State Exception occurs with Icefaces ee-3.3.0 maintenance branch r40863. Was not able to reproduce it with Icefaces 4. When re-selecting the Group checkboxes the following server error occurs:
        java.lang.IllegalStateException
        at com.sun.faces.context.FacesContextImpl.assertNotReleased(FacesContextImpl.java:654)
        at com.sun.faces.context.FacesContextImpl.getExternalContext(FacesContextImpl.java:139)
        at org.icefaces.impl.application.WindowScopeManager.lookupWindowScope(WindowScopeManager.java:83)
        at org.icefaces.impl.application.WindowELResolver.getScope(WindowELResolver.java:66)
        at org.icefaces.impl.application.WindowELResolver.getValue(WindowELResolver.java:36)
        at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
        at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
        at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:72)
        at org.apache.el.parser.AstValue.getValue(AstValue.java:161)
        at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:185)
        at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
        at org.icefaces.ace.component.row.Row$GroupPredicate.evaluate(Row.java:109)
        at org.icefaces.ace.component.row.Row.evaluateCondition(Row.java:70)
        at org.icefaces.ace.component.datatable.DataTable.getConditionalRows(DataTable.java:1281)
        at org.icefaces.ace.component.datatable.DataTableRowRenderer.encodeRow(DataTableRowRenderer.java:138)
        at org.icefaces.ace.component.datatable.DataTableRenderer.encodeTableBody(DataTableRenderer.java:296)
        at org.icefaces.ace.component.datatable.DataTableRenderer.encodeTable(DataTableRenderer.java:246)
        at org.icefaces.ace.component.datatable.DataTableRenderer.encodeEntirety(DataTableRenderer.java:173)
        at org.icefaces.ace.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:123)

        To reproduce:
        Test app at:
        http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/Nightly/dataTable
        Navigate to Conditional Row Test
        Select, then de-select the "Group - Before - GroupBy=Album:" checkbox
        Select, then de-select the "Group - After - GroupBy=Album:" checkbox
        Re-select the "Group - Before - GroupBy=Album:" checkbox.
        The class,java.lang.IllegalStateException will occur.

        Show
        Liana Munroe added a comment - An Illegal State Exception occurs with Icefaces ee-3.3.0 maintenance branch r40863. Was not able to reproduce it with Icefaces 4. When re-selecting the Group checkboxes the following server error occurs: java.lang.IllegalStateException at com.sun.faces.context.FacesContextImpl.assertNotReleased(FacesContextImpl.java:654) at com.sun.faces.context.FacesContextImpl.getExternalContext(FacesContextImpl.java:139) at org.icefaces.impl.application.WindowScopeManager.lookupWindowScope(WindowScopeManager.java:83) at org.icefaces.impl.application.WindowELResolver.getScope(WindowELResolver.java:66) at org.icefaces.impl.application.WindowELResolver.getValue(WindowELResolver.java:36) at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:72) at org.apache.el.parser.AstValue.getValue(AstValue.java:161) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:185) at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109) at org.icefaces.ace.component.row.Row$GroupPredicate.evaluate(Row.java:109) at org.icefaces.ace.component.row.Row.evaluateCondition(Row.java:70) at org.icefaces.ace.component.datatable.DataTable.getConditionalRows(DataTable.java:1281) at org.icefaces.ace.component.datatable.DataTableRowRenderer.encodeRow(DataTableRowRenderer.java:138) at org.icefaces.ace.component.datatable.DataTableRenderer.encodeTableBody(DataTableRenderer.java:296) at org.icefaces.ace.component.datatable.DataTableRenderer.encodeTable(DataTableRenderer.java:246) at org.icefaces.ace.component.datatable.DataTableRenderer.encodeEntirety(DataTableRenderer.java:173) at org.icefaces.ace.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:123) To reproduce: Test app at: http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/Nightly/dataTable Navigate to Conditional Row Test Select, then de-select the "Group - Before - GroupBy=Album:" checkbox Select, then de-select the "Group - After - GroupBy=Album:" checkbox Re-select the "Group - Before - GroupBy=Album:" checkbox. The class,java.lang.IllegalStateException will occur.
        Hide
        Arturo Zambrano added a comment -

        Committed fix for exception above to 4.0 trunk at revision 40877 and to 3.3 EE maintenance branch at revision 40878. Removed FacesContext object as an instance variable from GroupPredicate class, in order to avoid IllegalStateException exception.

        Show
        Arturo Zambrano added a comment - Committed fix for exception above to 4.0 trunk at revision 40877 and to 3.3 EE maintenance branch at revision 40878. Removed FacesContext object as an instance variable from GroupPredicate class, in order to avoid IllegalStateException exception.
        Hide
        Liana Munroe added a comment -

        Confirmed fixed Icefaces ee-3.3.0 maintenance branch, IF4 trunk, r40879. Tomcat 7, all browsers.

        Show
        Liana Munroe added a comment - Confirmed fixed Icefaces ee-3.3.0 maintenance branch, IF4 trunk, r40879. Tomcat 7, all browsers.

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Cruz Miraback
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: