我目前在使用带有 portlet 插件的 struts2 在集群环境中实现 jsr 168 portlet 时遇到问题。每当我使用模型驱动接口并提交表单时,我都会收到以下堆栈跟踪:
SEVERE: Unable to serialize delta request for sessionid [0F246549355FD6749A5CF6EAE761F77F.worker1]
java.io.NotSerializableException: com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at com.opensymphony.xwork2.inject.util.ReferenceMap.writeObject(ReferenceMap.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
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:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at java.util.ArrayList.writeObject(ArrayList.java:570)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
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:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.writeExternal(DeltaRequest.java:389)
at org.apache.catalina.ha.session.DeltaRequest.writeExternal(DeltaRequest.java:287)
at org.apache.catalina.ha.session.DeltaRequest.serialize(DeltaRequest.java:302)
at org.apache.catalina.ha.session.DeltaManager.serializeDeltaRequest(DeltaManager.java:725)
at org.apache.catalina.ha.session.DeltaManager.requestCompleted(DeltaManager.java:1233)
at org.apache.catalina.ha.session.DeltaManager.requestCompleted(DeltaManager.java:1198)
at org.apache.catalina.ha.tcp.ReplicationValve.send(ReplicationValve.java:550)
at org.apache.catalina.ha.tcp.ReplicationValve.sendMessage(ReplicationValve.java:537)
at org.apache.catalina.ha.tcp.ReplicationValve.sendCrossContextSession(ReplicationValve.java:457)
at org.apache.catalina.ha.tcp.ReplicationValve.sendReplicationMessage(ReplicationValve.java:432)
at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:363)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
复制问题的示例程序 git://github.com/ctwomey1/Struts2PortletExample.git
我已经在运行 pluto 1.1.7 的 tomcat 6.0.33 中复制了这个问题。我在 struts 2.1.3.2 和 2.3.3 上试过这个
如果有人看到我做错了什么,我会喜欢建议:)
更新:我已将此记录为 struts2 portlet 插件的问题。我定期研究解决方案