[MAGNOLIA-765] session must be serializable (session clustering failing) Created: 14/Mar/06  Updated: 23/Jan/13  Resolved: 16/Apr/07

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 3.0 Beta 1
Fix Version/s: 3.1 M1

Type: Bug Priority: Blocker
Reporter: Nicolas Modrzyk Assignee: Sameer Charles
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Any (linux, java 6)


Issue Links:
relation
is related to MAGNOLIA-1444 Review ContentRepository/SessionStore Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

I put in the magnoliaAuthor war into webapps
Then added <distributed /> to the Author webapps to enable clustering/session failover
Also uncommented the Cluster setting as well.
I tried connecting to one of the Tomcat instances directly to double check things are working
And found I could not connect to the Magnolia author at all
In catalina.out there is the following message:

ERROR info.magnolia.cms.filters.SecurityFilter SecurityFilter.java(authenticate:120) 14.03.2006 16:28:39 Attribute [mgnlUserNode] is not serializable
java.lang.IllegalArgumentException: Attribute [mgnlUserNode] is not serializable
at org.apache.catalina.cluster.session.DeltaSession.setAttribute(DeltaSession.java:1229)
at org.apache.catalina.cluster.session.DeltaSession.setAttribute() ...



 Comments   
Comment by Philipp Bracher [ 14/Mar/06 ]

The users content node and the hierarchymanagers are not serializable. This is a well known problem since a long time and we should solve it definitly.

I don't know the details but if you cluster with sticky sessions it should work (see appache tomcat connector).

Here are some possible solutions:

A) no hierarchymanagers and usernodes in sessions

I don't know the cost of createing a jcr session, but if this is not to expensive we could make a ClusterableContext which stores the jcr- objects in the request instead of the session

B) make the objects serializable
If a node get's serializabled it stores only it's handle (rest is transient). The same we could do with the hierarchymanager. In fact this would leed indirectly to the same solution as A (creating the objects per request)

C) Pool of hierarchymanagers
If the costs of creating a jcr session are to big we could implement a pool of hierarchymanagers and they are initialized on a request base (AccessManager, ...)

Comment by Philipp Bracher [ 16/Mar/07 ]

This is must for making the session really clusterable.

Comment by Philipp Bracher [ 22/Mar/07 ]

SessionStore must be refacterd

  • rename to RepositoryObjectCreationHelper (or better if you find a better nam
  • uncouple it from storing the objects in the session (this is the job of the context)
Comment by Sameer Charles [ 12/Apr/07 ]

DefaultHierarchyManager and User(impls) will be serializable

This would help you to use HttpSession as serializable container for custom data but I would not try to cluster application with shared session, Since almost all good webservers like WebSphere and Apache allow Session affinity.

Comment by Sameer Charles [ 16/Apr/07 ]

done

  • All objects associated to HttpSession are searializable
  • WorkspaceAccessUtil replaces SessionStore providing all magnolia specific objects needed to accees JCR
Generated at Mon Feb 12 03:20:27 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.