Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1.6
-
None
-
myfaces-api-1.1.5.jar
myfaces-impl-1.1.5.jar
tomahawk-1.1.6.jar
apache-tomcat-6.0.16
Description
It occured a NullPointerException when submitted a "t:datatable".
I set a "t:datatable" as follow:
<t:dataTable id="searchResult" preserveDataModel="true" value='#
' var="list" border="1">
testBean: BackingBean
formData: an Object of HashMap type
formData["employeeList"] contains a ArrayList Object which was the datas searched form database.
When submit this form, it occures NullPointerException(From Tomcat).
2008-2-17 15:56:39 org.apache.catalina.core.StandardWrapperValve invoke
Serious: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException
at org.apache.myfaces.component.html.ext.HtmlDataTable.updateModelFromPreservedDataModel(HtmlDataTable.java:502)
at org.apache.myfaces.component.html.ext.HtmlDataTable.processUpdates(HtmlDataTable.java:464)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:648)
at javax.faces.component.UIForm.processUpdates(UIForm.java:90)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:648)
at javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:160)
at org.apache.myfaces.lifecycle.UpdateModelValuesExecutor.execute(UpdateModelValuesExecutor.java:33)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
I track the Tomahawk source and found the following source:
501: List lst = (List) dm.getWrappedData();
502: if (lst.size() > 0)
503:
506: else
507:
I think if the "lst" object is empty(size() == 0), the "context" was set to null,
So, when "lst" obeject is null, the "context" also should be set to null, so I changed the source at my local as folloing,
ant it runs.
501: List lst = (List) dm.getWrappedData();
502: if (lst != null && lst.size() > 0)
503:
506: else
507: