Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.1-Beta
-
Component/s: ACE-Components
-
Labels:None
-
Environment:ACE, Mojarra 2.1.3
-
Assignee Priority:P1
Description
An exception occurs when using ace:dataTable and a header columnGroup, and trying to sort.
From the server log we can see that ColumnBase is trying to state save a Map, which has a null value in it, that's causing the exception. Since column has no Map properties, and the stack trace isn't showing much saveState recursion, it's likely that it's the StateHelper's own Map that has the null entry.
java.lang.NullPointerException
at javax.faces.component.StateHolderSaver.<init>(StateHolderSaver.java:96)
at javax.faces.component.UIComponentBase.saveAttachedState(UIComponentBase.java:1695)
at javax.faces.component.ComponentStateHelper.saveMap(ComponentStateHelper.java:378)
at javax.faces.component.ComponentStateHelper.saveState(ComponentStateHelper.java:256)
at javax.faces.component.UIComponentBase.saveState(UIComponentBase.java:1501)
at org.icefaces.ace.component.column.ColumnBase.saveState(ColumnBase.java:1324)
at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:168)
at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151)
at org.icefaces.ace.component.datatable.DataTable.visitColumnsAndColumnFacets(DataTable.java:502)
at org.icefaces.ace.component.datatable.DataTable.visitTree(DataTable.java:466)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIForm.visitTree(UIForm.java:344)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at com.sun.faces.application.view.StateManagementStrategyImpl.saveView(StateManagementStrategyImpl.java:160)
at com.sun.faces.application.StateManagerImpl.saveView(StateManagerImpl.java:133)
at javax.faces.application.StateManager.getViewState(StateManager.java:553)
at org.icefaces.impl.context.DOMPartialViewContext.renderState(DOMPartialViewContext.java:448)
at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:205)
at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:981)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:390)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
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)
From the server log we can see that ColumnBase is trying to state save a Map, which has a null value in it, that's causing the exception. Since column has no Map properties, and the stack trace isn't showing much saveState recursion, it's likely that it's the StateHelper's own Map that has the null entry.
java.lang.NullPointerException
at javax.faces.component.StateHolderSaver.<init>(StateHolderSaver.java:96)
at javax.faces.component.UIComponentBase.saveAttachedState(UIComponentBase.java:1695)
at javax.faces.component.ComponentStateHelper.saveMap(ComponentStateHelper.java:378)
at javax.faces.component.ComponentStateHelper.saveState(ComponentStateHelper.java:256)
at javax.faces.component.UIComponentBase.saveState(UIComponentBase.java:1501)
at org.icefaces.ace.component.column.ColumnBase.saveState(ColumnBase.java:1324)
at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:168)
at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151)
at org.icefaces.ace.component.datatable.DataTable.visitColumnsAndColumnFacets(DataTable.java:502)
at org.icefaces.ace.component.datatable.DataTable.visitTree(DataTable.java:466)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIForm.visitTree(UIForm.java:344)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at com.sun.faces.application.view.StateManagementStrategyImpl.saveView(StateManagementStrategyImpl.java:160)
at com.sun.faces.application.StateManagerImpl.saveView(StateManagerImpl.java:133)
at javax.faces.application.StateManager.getViewState(StateManager.java:553)
at org.icefaces.impl.context.DOMPartialViewContext.renderState(DOMPartialViewContext.java:448)
at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:205)
at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:981)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:390)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
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)
Issue Links
- blocks
-
ICE-7329 ace:dataTable - sorting not working for table using column grouping
- Closed
Had to differentiate between primitive values, that cannot be null, and non-primitives, that can be null. The code for setting the defVal is a little funky, but after careful consideration I don't think it should cause any problems.
Internal development repository
Subversion 25914
ace/generator/src/org/icefaces/ace/generator/artifacts/ComponentArtifact.java