11 Replies Latest reply on Apr 27, 2005 11:30 PM by rpolisetty1

    session persistence config

    kirkh

      Where is the Tomcat session persistance configuration set in JBoss? I want to turn it off in the PersistenceManager setting, but I can't find it in any of the configuration files.

      If you know how to turn off the http session persistence, please let me know.
      Thanks,
      kirk

        • 1. Re: session persistence config
          paveu

          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

            Me too! : -(

            Hope to see an expert reply.

            • 3. Re: session persistence config
              camel

               

              "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

                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

                  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

                    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

                      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

                        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

                          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

                          • 10. Re: session persistence config
                            starksm64
                            • 11. Re: session persistence config
                              rpolisetty1

                              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