使用Primefaces和Weblogic的java.io.NotSerializableException

时间:2018-01-30 15:32:33

标签: jsf primefaces jsf-2 weblogic

我使用在群集WebLogic Server上运行的Primefaces 6.1(Mojarra 2.2.8)版本:12.2.1.3.0并且在会话复制期间我得到以下异常:

<Jan 30, 2018 4:08:08,727 PM CET> <Error> <Cluster> <BEA-003144> <All session objects should be serializable to replicate. Check the objects in the session. Failed to replicate a non-serializable object in context /app.
java.rmi.MarshalException: failed to marshal create(Lweblogic.rmi.spi.HostID;ILweblogic.cluster.replication.ROID;Ljava.io.Serializable;); nested exception is: 
java.io.NotSerializableException: org.primefaces.model.SortMeta
at weblogic.rjvm.BasicOutboundRequest.marshalArgs(BasicOutboundRequest.java:100)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:297)
at weblogic.cluster.replication.RemoteReplicationServicesInternalImpl_12213_WLStub.create(Unknown Source)
at sun.reflect.GeneratedMethodAccessor1191.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Truncated. see log file for complete stacktrace
Caused By: java.io.NotSerializableException: org.primefaces.model.SortMeta
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at java.util.ArrayList.writeObject(ArrayList.java:766)
at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Truncated. see log file for complete stacktrace
  

JSF组件绑定从未在应用程序中使用。查看Primefaces源代码,我可以看到模型SortMeta(不实现Serializable)仅用于DataTable组件。

视图状态保存方法必须是服务器端。

如何解决或避免此异常?

修改

问题是由&#34; new&#34; datatable属性multiViewState。

https://forum.primefaces.org/viewtopic.php?f=3&t=54138&p=164132

Class SortMeta现在可以序列化: https://github.com/primefaces/primefaces/issues/3272

0 个答案:

没有答案