-
1. Re: session persistence config
paveu Jun 23, 2004 4:04 AM (in response to kirkh)Hi!
I'd be also glad to know that. It's driving me crazy 'cause I need to use non serializable objects stored in a user session.
I tried many combinations to disable persisting the sessions by Tomcat but unfortunatelly it all applied to standalone Tomcat and was completly ignored by the one embedded in JBoss.
So please if anyone knows how to make the embeded Tomcat 5.0.19 in JBoss 3.2.4 stop persisting sessions, let us know before we go mad :-\
Thanks in advance
Pawel -
2. Re: session persistence config
linux Aug 4, 2004 3:06 AM (in response to kirkh)Me too! : -(
Hope to see an expert reply. -
3. Re: session persistence config
camel Aug 5, 2004 9:42 AM (in response to kirkh)"paveu" wrote:
I need to use non serializable objects stored in a user session.
I tried many combinations to disable persisting the sessions by Tomcat but unfortunatelly it all applied to standalone Tomcat and was completly ignored by the one embedded in JBoss.
You could mark the non-serializable fields as transient, that way they won't be serialized, and it will work under either configuration (jboss or standalone tomcat).
If you need to restore the non-serializable fields when the sessions are re-loaded, you can do it using an HttpSessionActivationListener. See this article for an example: http://www.onjava.com/pub/a/onjava/2004/07/14/clustering.html.
I've been doing that and it works great, and saves loads of time when doing lots of redeploys during development. -
4. Re: session persistence config
rickkw Oct 21, 2004 3:12 PM (in response to kirkh)The transient keyword is only good for class fields. It won't work if the object being inserted into a session itself does not implement the Serializable interface. Session persistence is a great thing, but it should be optional. As it is, it is a pain if I don't want session persistence. Shutting down JBoss takes a very long time because each of my 40+ applications were busy serializing session data that I don't care less.
Based on various suggestions and documentation. I have tried modifying Tomcat and adding a in a with no success. Tomcat just stubornly writes out SESSION.ser. -
5. Re: session persistence config
anil.saldhana Oct 21, 2004 5:44 PM (in response to kirkh)In your war file, under WEB-INF, create a context.xml with the following info. Tell us if it works.
<Context> <Manager className="org.apache.catalina.session.StandardManager" pathname=""> </Manager> </Context>
-
6. Re: session persistence config
tinghe Nov 10, 2004 1:37 PM (in response to kirkh)yep, that works in 3.2.6 (turn off tomcat session persistence). It won't work in pre 3.2.6 jboss and beware element names in context.xml are case sensitive, e.g. use "Context" not "context".
-
7. Re: session persistence config
paveu Jan 4, 2005 7:49 AM (in response to kirkh)Hi!
Thanks for replies. I've already forgot about this thread and got used to this "great" session persisting...
I have some troubles migrating from 3.2.5 to 3.2.6 so probably I'll have to still like session persisting till I mangage to fully migrate.
By this time I'll give a try switching off session persisting in 3.2.6 and let You know the results.
Regards
Pawel -
8. Re: session persistence config
paveu Jan 5, 2005 6:36 AM (in response to kirkh)Hi again!
tinghe, you were completly right. It works just fine but only in JBoss 3.2.6 not any earlier version.
Regards
Pawel -
9. Re: session persistence config
rpolisetty1 Apr 24, 2005 9:46 AM (in response to kirkh)Did anyone try this in JBoss 4.0.0?
I get the following exception on shutdown and
I would love to turn off the serialization and the eventual errors on startup.
06:31:21,970 INFO [session.ManagerBase] Cannot serialize session attribute X for session 93980FC2905F149809B62B7B1D9E548A
Thanks,
Ramesh -
-
11. Re: session persistence config
rpolisetty1 Apr 27, 2005 11:30 PM (in response to kirkh)Its working now.
What is needed is to create a create a WEB-INF/context.xml descriptor with an empty pathname value for the Manager as shown here:
Thanks,
Ramesh