Bug 52558 - CometConnectionManagerValve is adding non-serializable Request[] to Session
CometConnectionManagerValve is adding non-serializable Request[] to Session
Status: RESOLVED FIXED
Product: Tomcat 8
Classification: Unclassified
Component: Catalina
8.0.0-RC1
Macintosh All
: P2 enhancement (vote)
: ----
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2012-01-30 10:46 UTC by adam hawkins
Modified: 2013-09-12 11:17 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description adam hawkins 2012-01-30 10:46:47 UTC
CometConnectionManagerValve is adding HttpServletRequest[] to HttpSession which is preventing the Session being serialized in a Clustered setup.

We're resolving this locally using a serializable ConnectionList class with a transient Request[]

i.e.

public class ConnectionList implements Serializable {
	
	transient Request[] connectionList = null;
	
	ConnectionList(Request[] connectionList){
		this.connectionList = connectionList;
	}
	
	public Request[] get(){
		return connectionList;
	}
}
Comment 1 Rainer Jung 2012-01-30 10:59:05 UTC
Note that there is an attribute "sessionAttributeFilter" in the cluster manager configuration, that allows to decide which session attributes you want to be replicated. It was introduced in Tomcat 7.0.22.

See:

http://tomcat.apache.org/tomcat-7.0-doc/config/cluster-manager.html

It is not a direct answer to your observation, but might be enough for a workaround. Therefore I keep this issue in status "New".

Regards,

Rainer
Comment 2 Mark Thomas 2013-09-12 11:17:37 UTC
I'd be surprised if anyone was relying on the connection list being stored as an array of requests but in case they are it is safer to use the work=around for 7.0.x and earlier. I have applied a fix based on the suggested new class for Tomcat 8.