Error  Cluster All session objects should be serializable to replicate. Check the objects in your session. Failed to replicate non-serializable object.


在本地环境中,前端使用的是radware的WSD来做应用分发,但是在客户环境中使用的是HAproxy来做代理分发,在haproxy的配置中一直使用的默认配置cookie  SERVERID,今天啃了一下帮助文档,其中有针对应用session的定义部分:

2.11) Application Cookies
Since 1.2.4 it is possible to catch the cookie that comes from an
application server in order to apply “application session stickyness”.
The server's response is searched for 'appsession' cookie, the first
'len' bytes are used for matching and it is stored for a period of
The syntax is:

   appsession len timeout

is the cookie, the server uses for it's session-handling
how many bytes/characters should be used for matching equal
after this inactivaty time, in ms, the cookie will be deleted
            from the sessionstore

The appsession is only per 'listen' section possible.

Example :
   listen http_lb1
      mode    http
      capture request  header Cookie len 200
      # Havind a ServerID cookie on the client allows him to reach
      # the right server even after expiration of the appsession.
      cookie ServerID insert nocache indirect
      # Will memorize 52 bytes of the cookie 'JSESSIONID' and keep them
      # for 3 hours. It will match it in the cookie and the URL field.
      appsession JSESSIONID len 52 timeout 10800000
      server first1 check inter 3000 cookie first
      server secon1 check inter 3000 cookie secon
      server first1 check inter 3000 cookie first
      server secon2 check inter 3000 cookie secon
      option httpchk GET /test.jsp

按照文档中的做了相应修改:appsession JSESSIONID len 52 timeout 10800000