[
https://jira.jboss.org/jira/browse/RF-4117?page=com.atlassian.jira.plugin...
]
Jan Ziegler commented on RF-4117:
---------------------------------
I think I found the solution by myself, but first some example code:
Bean:
public class TestBean implements Serializable
{
private HtmlDataTable dataTable = new HtmlDataTable();
public HtmlDataTable getDataTable()
{
return this.dataTable;
}
public void setDataTable(HtmlDataTable dataTable)
{
this.dataTable = dataTable;
}
}
XHTML:
<t:saveState value="#{testBean}" />
<h:dataTable binding="#{testBean.dataTable}" />
<h:form>
<h:commandButton value="doAction" action="someAction"/>
</h:form>
The problem is explained here:
http://www.mail-archive.com/users@myfaces.apache.org/msg14990.html
If you use <t:saveState> for caching a bean in the viewRoot it will be serialized
and therefor all of its members. But HtmlDataTable is not serializable by spec.
The solution is to make the HtmlDataTable in the bean TRANSIENT:
private transient HtmlDataTable dataTable = new HtmlDataTable();
So the problem is not a Richfaces problem I think. It´s just appearing right now, because
State-Saving is "activated" after implementation of RF-4108.
Does this mean, that org.apache.myfaces.SERIALIZE_STATE_IN_SESSION wasn´t recognized
before?
NotSerializableException on HtmlDataTable since Fix for RF-4108 when
state serialization is turned on
-----------------------------------------------------------------------------------------------------
Key: RF-4117
URL:
https://jira.jboss.org/jira/browse/RF-4117
Project: RichFaces
Issue Type: Bug
Affects Versions: 3.2.2
Environment: Tomcat 6.0.16
MyFaces 1.2.3
Facelets 1.1.15 Snapshot
Tomahawk 1.1.17 Snapshot
Richfaces 3.2.2 (20080808)
Reporter: Jan Ziegler
Since the bugfix for RF-4108 in 3.2.2 Snapshot I always get the following exception when
using a h:dataTable:
java.io.NotSerializableException: javax.faces.component.html.HtmlDataTable
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at java.util.ArrayList.writeObject(ArrayList.java:570)
at sun.reflect.GeneratedMethodAccessor144.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at java.util.ArrayList.writeObject(ArrayList.java:570)
at sun.reflect.GeneratedMethodAccessor144.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at org.ajax4jsf.application.AjaxStateManager.handleSaveState(AjaxStateManager.java:336)
... 29 more
My settings in web.xml:
<context-param>
<param-name>
org.apache.myfaces.SERIALIZE_STATE_IN_SESSION
</param-name>
<param-value>true</param-value>
</context-param>
Greetz
Jan
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira