[
https://issues.apache.org/jira/browse/TOMAHAWK-1460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026298#comment-13026298
]
Krashan Brahmanjara commented on TOMAHAWK-1460:
-----------------------------------------------
This error still exist. Verified on Jboss 5.1 with tomahawk-1.1.10.jar and
myfaces-impl-1.1.9.jar.
15:01:53,471 FATAL [FacesPortlet] Uncaught error occured in portlet
java.lang.ClassCastExceptionjavax.faces.model.ListDataModel cannot be cast to
org.apache.myfaces.component.html.ext._SerializableDataModel
15:01:53,471 ERROR [FacesPortlet] javax.faces.model.ListDataModel cannot be
cast to org.apache.myfaces.component.html.ext._SerializableDataM
odel
java.lang.ClassCastException: javax.faces.model.ListDataModel cannot be cast to
org.apache.myfaces.component.html.ext._SerializableDataModel
at
org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.updateModelFromPreservedDataModel(AbstractHtmlDataTable.java:648)
at
org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.processUpdates(AbstractHtmlDataTable.java:634)
at
org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.process(AbstractHtmlDataTable.java:573)
at
org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.processDetails(AbstractHtmlDataTable.java:514)
at
org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.processUpdates(AbstractHtmlDataTable.java:629)
at
javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:941)
at javax.faces.component.UIForm.processUpdates(UIForm.java:123)
at
javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:941)
at javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:180)
at
org.apache.myfaces.lifecycle.UpdateModelValuesExecutor.execute(UpdateModelValuesExecutor.java:33)
at
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:105)
at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:80)
at
org.apache.portals.bridges.jsf.FacesPortlet.process(FacesPortlet.java:441)
at
org.apache.portals.bridges.jsf.FacesPortlet.processAction(FacesPortlet.java:313)
> ClassCastException when testing Tomahawk 1.1.9 table demos when
> preserveDataModel="true"
> ----------------------------------------------------------------------------------------
>
> Key: TOMAHAWK-1460
> URL: https://issues.apache.org/jira/browse/TOMAHAWK-1460
> Project: MyFaces Tomahawk
> Issue Type: Bug
> Components: Extended Datatable
> Affects Versions: 1.1.9
> Environment: Mac OS 10.5.8
> JDK 1.6.0
> Mojarra 2.0.0-SNAPSHOT
> Glassfish V3
> Reporter: Ryan Lubke
> Assignee: Leonardo Uribe
> Fix For: 1.1.10
>
>
> When executing 'Paged and Sortable', 'Master-Detail', and 'Optional
> Header/Footer', a class cast exception is raised during post-back operations
> to
> update the view.
> java.lang.ClassCastException: javax.faces.model.ListDataModel cannot be cast
> to
> org.apache.myfaces.component.html.ext._SerializableDataModel
> at
> org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.updateModelFromPreservedDataModel(AbstractHtmlDataTable.java:493)
> at
> org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.processUpdates(AbstractHtmlDataTable.java:479)
> at
> javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1108)
> at javax.faces.component.UIForm.processUpdates(UIForm.java:265)
> at
> javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1108)
> at javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:1238)
> I've done some debugging here and have found this block of code being executed
> during processRestoreState():
> protected DataModel getDataModel()
> {
> if (_preservedDataModel != null)
> {
> setDataModel(_preservedDataModel);
> _preservedDataModel = null;
> }
> return super.getDataModel();
> }
> The call stack at this point in time is:
> at
> org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.getDataModel(AbstractHtmlDataTable.java:839)
> at
> org.apache.myfaces.component.html.ext.HtmlDataTableHack.setRowIndex(HtmlDataTableHack.java:282)
> at
> org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.setRowIndex(AbstractHtmlDataTable.java:276)
> at javax.faces.component.UIData.visitColumnsAndRows(UIData.java:1539)
> at javax.faces.component.UIData.visitTree(UIData.java:1207)
> at javax.faces.component.UIComponent.visitTree(UIComponent.java:1454)
> at javax.faces.component.UIComponent.visitTree(UIComponent.java:1454)
> at javax.faces.component.UIForm.visitTree(UIForm.java:333)
> at javax.faces.component.UIComponent.visitTree(UIComponent.java:1454)
> at
> javax.faces.component.UIViewRoot.processRestoreState(UIViewRoot.java:868)
> The interesting point here is that _preserveDataModel is set to null.
> Later, during processUpdates(), updateModelFromPreservedDataModel() will
> call getDataModel (as listed above), however, since _preservedDataModel was
> set
> to null, the call is delegated to the super class, UIData, which returns
> ListDataModel.
> This change in the code path is new spec required functionality where
> UIViewRoot.processRestoreState()
> uses the TreeVisitor to notify components of the PostRestoreStateEvent.
> Given this, I'm sure the
> problem will be manifest with MyFaces 2.0.0.
> WORKAROUND: set preservDataModel to false.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira