Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-2803

TokenSessionStoreInterceptor - puting non Serializable objects in the Session

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.0.11
    • 2.3.15
    • Core Interceptors
    • None
      • CentOS Linux
      • Tomcat 6.0.16
      • Struts 2.0.11

    Description

      I haven't found any issues for this, neither on the mailling lists, so i'm opening one.

      I'm intercepting an Action with the TokenSession Interceptor, it works fine, but it is saving a non Serializable object (org.apache.struts2.dispatcher.StrutsRequestWrapper) on the session, so in a tomcat cluster environment the session cannot be serialized and sent to the other machine.

      The class that is been saved in the session is the below:
      org.apache.struts2.util.InvocationSessionStore$InvocationContext on the "extraContext" attribute inside this class

      The DeltaManager is complaning about StrutsRequestWrapper, and indeed it is not serializable. Could it be made Serializable? Or it is not suposed to be?

      There's a full stackTrace:
      Sep 12, 2008 2:12:57 PM org.apache.catalina.ha.session.DeltaManager requestCompleted
      SEVERE: Unable to serialize delta request for sessionid [3A52D19C6BC693E3B2C388EC050439DF]
      java.io.NotSerializableException: org.apache.struts2.dispatcher.StrutsRequestWrapper
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
      at java.util.HashMap.writeObject(HashMap.java:1001)
      at sun.reflect.GeneratedMethodAccessor126.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.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.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.writeObject(ObjectOutputStream.java:326)
      at java.util.HashMap.writeObject(HashMap.java:1001)
      at sun.reflect.GeneratedMethodAccessor126.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.writeObject(ObjectOutputStream.java:326)
      at org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.writeExternal(DeltaRequest.java:374)
      at org.apache.catalina.ha.session.DeltaRequest.writeExternal(DeltaRequest.java:272)
      at org.apache.catalina.ha.session.DeltaRequest.serialize(DeltaRequest.java:287)
      at org.apache.catalina.ha.session.DeltaManager.serializeDeltaRequest(DeltaManager.java:633)
      at org.apache.catalina.ha.session.DeltaManager.requestCompleted(DeltaManager.java:1108)
      at org.apache.catalina.ha.tcp.ReplicationValve.send(ReplicationValve.java:548)
      at org.apache.catalina.ha.tcp.ReplicationValve.sendMessage(ReplicationValve.java:535)
      at org.apache.catalina.ha.tcp.ReplicationValve.sendSessionReplicationMessage(ReplicationValve.java:517)
      at org.apache.catalina.ha.tcp.ReplicationValve.sendReplicationMessage(ReplicationValve.java:428)
      at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:362)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
      at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:879)
      at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:719)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2080)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      at java.lang.Thread.run(Thread.java:619)

      Attachments

        Activity

          People

            lukaszlenart Lukasz Lenart
            juliano.carniel Juliano Carniel
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: