Richfaces数据表异常:java.io.NotSerializableException

时间:2013-01-11 09:59:05

标签: jsf richfaces

我正在使用JSF 2.1,Richfaces 4.2.2,对于下面提到的代码我得到了java.io.NotSerializableException:org.richfaces.component.SavedState异常。

Bean范围:会话

Facelet代码:

<rich:dataTable id="table" value="#{mapActivityGroup.addActivityGroupModelList}" 
      var="model">
    <rich:column>
        <h:selectBooleanCheckbox id="checkBox" value="#{model.selected}" />
    </rich:column>
    <rich:column filterValue="#{mapActivityGroup.categoryFilter}" 
                 filterExpression="#{fn:containsIgnoreCase(model.categoryName,
                 mapActivityGroup.categoryFilter)}" >
        <f:facet name="header">
            <h:panelGroup>
                <h:outputText value="Category" />
                <h:inputText value="#{mapActivityGroup.categoryFilter}">
                    <a4j:ajax render="table" execute="@this" event="blur" />
                </h:inputText>
            </h:panelGroup> 
        </f:facet>
        <h:outputText value="#{model.categoryName==null?'':model.categoryName}"/>
    </rich:column>
</rich:dataTable>

例外:

java.io.NotSerializableException: org.richfaces.component.SavedState
    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180)
    java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
    java.util.HashMap.writeObject(HashMap.java:1100)
    sun.reflect.GeneratedMethodAccessor1947.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:601)
    java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:975)
    java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
    java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
    java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)

我用Google搜索但是找不到任何重大内容。有谁知道为什么会这样?

1 个答案:

答案 0 :(得分:1)

在web.xml中,我将javax.faces.STATE_SAVING_METHOD更改为server,然后才有效。