Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 3.0
-
Fix Version/s: 3.1.0.BETA1, 3.1
-
Component/s: ACE-Components
-
Labels:None
-
Environment:IceFaces 3.0.0 JSF 2.1.4
-
Affects:Documentation (User Guide, Ref. Guide, etc.), Compatibility/Configuration
-
Workaround Exists:Yes
-
Workaround Description:
Description
Hi,
I have this ace data table declaration in a page:
<ace:dataTable
id="someId"
value="#{SomeBean.rows}"
var="row"
scrollable="true"
scrollHeight="450px"
rendered="#{SomeBean.renderCondition}"
stateMap="#{SomeBean.rowStateMap}"
selectionMode="single"
rowSelectListener="#{SomeBean.rowSelListener}"
rowUnselectListener="#{SomeBean.rowUnSelListener}"
>
<ace:ajax event="select" />
<ace:column>
<h:outputText id="someId2" value="#{row.someProperty}" />
</ace:column>
</ace:dataTable>
When I try to access the page I get this exception:
java.lang.NullPointerException
at org.icefaces.ace.component.datatable.DataTableRenderer.encodeScript(DataTableRenderer.java:512)
at org.icefaces.ace.component.datatable.DataTableRenderer.encodeEntierty(DataTableRenderer.java:567)
at org.icefaces.ace.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:112)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1763)
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:845)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:146)
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)
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:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1815)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
I identified the problem in DataTableRenderer.java row 512: if (table.getHeight() != Integer.MIN_VALUE) writer.write(",height:" + table.getHeight());
It appears that if getHeight returns null when java attempts an out boxing on null it throws a NPE
You should check the components and renderers for similar issues.
Thank you
I have this ace data table declaration in a page:
<ace:dataTable
id="someId"
value="#{SomeBean.rows}"
var="row"
scrollable="true"
scrollHeight="450px"
rendered="#{SomeBean.renderCondition}"
stateMap="#{SomeBean.rowStateMap}"
selectionMode="single"
rowSelectListener="#{SomeBean.rowSelListener}"
rowUnselectListener="#{SomeBean.rowUnSelListener}"
>
<ace:ajax event="select" />
<ace:column>
<h:outputText id="someId2" value="#{row.someProperty}" />
</ace:column>
</ace:dataTable>
When I try to access the page I get this exception:
java.lang.NullPointerException
at org.icefaces.ace.component.datatable.DataTableRenderer.encodeScript(DataTableRenderer.java:512)
at org.icefaces.ace.component.datatable.DataTableRenderer.encodeEntierty(DataTableRenderer.java:567)
at org.icefaces.ace.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:112)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1763)
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:845)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:146)
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)
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:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1815)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
I identified the problem in DataTableRenderer.java row 512: if (table.getHeight() != Integer.MIN_VALUE) writer.write(",height:" + table.getHeight());
It appears that if getHeight returns null when java attempts an out boxing on null it throws a NPE
You should check the components and renderers for similar issues.
Thank you
This example uses the incorrect attribute to define height, resulting in a null pointer during the script creation for the scrollable table.
<ace:dataTable
{SomeBean.rows}"id="someId"
value="#
var="row"
scrollable="true"
scrollHeight="450px"
rendered="#{SomeBean.renderCondition}"
stateMap="#{SomeBean.rowStateMap}"
selectionMode="single"
rowSelectListener="#{SomeBean.rowSelListener}"
rowUnselectListener="#{SomeBean.rowUnSelListener}"
>
<ace:ajax event="select" />
<ace:column>
<h:outputText id="someId2" value="#{row.someProperty}" />
</ace:column>
</ace:dataTable>
changing 'scrollHeight' to 'height' will fix this issue.
<ace:dataTable
id="someId"
value="#{SomeBean.rows}
"
{SomeBean.renderCondition}var="row"
scrollable="true"
height="450"
rendered="#
"
{SomeBean.rowStateMap}stateMap="#
"
{SomeBean.rowSelListener}selectionMode="single"
rowSelectListener="#
"
{SomeBean.rowUnSelListener}rowUnselectListener="#
"
{row.someProperty}>
<ace:ajax event="select" />
<ace:column>
<h:outputText id="someId2" value="#
" />
</ace:column>
</ace:dataTable>