3 Replies Latest reply on Jul 16, 2004 9:32 AM by pcolagrosso

    How to disable session persistence ?

    tulbiak

      Hello..8)..
      I use in a development environment JBOSS 3.2.5, Windows 2003 and JDK 1.4.2.
      For development convenience, my server configuration use a specific URL to deploy the EAR (in an external CVS directory)

      <attribute name="URLs">
       deploy/,@APPLICATION_URL@
      </attribute>


      All works great except when the server is shutdown with some sessions still running. The standard manager store them into SESSIONS.ser and bring them on in startup, generating errors. I would like to disable this feature. I tried to add a new Manager configuration in the DefaultContext tag (server.xml) without success. I tried to create a context.xml in the META-INF/.
      Now i use a custom run.bat that deletes the SESSIONS.ser files at startup. It works but i would like to know if there is a way to disable the session persistence.

      Thanks,

        • 1. Re: How to disable session persistence ?
          pcolagrosso

          Hi,

          In order to disable the tomcat persistent session, I made the following change to the bundled tomcat configuration and it seems to work well for me.

          In the file deploy/jbossweb-tomcat50.sar/server.xml, change the existing DefaultContext element so that it looks as follows:

           <DefaultContext cookies="true" crossContext="true" override="true">
           <Manager classname="org.apache.catalina.session.StandardManager" pathname="" /> </DefaultContext>
          


          Setting the pathname attribute to null tells the StandardManager (default Tomcat session manager) that session persistence is not desired. This is as per the Tomcat API documentation, see method setPathName of class StandardManager: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/catalina/docs/api/org/apache/catalina/session/StandardManager.html#getPathname()

          You may also want to note that prior to JBoss 3.2.5, the server.xml configuration did not exist and the
          Tomcat server configuration parameters had to be defined in the jboss-service.xml file located in the META-INF directory of the bundle tomcat SAR.

          Cheers,

          Piero

          • 2. Re: How to disable session persistence ?
            tulbiak

            Hello Piero..8)..

            Thanks for your answer !

            I have tried this setting and it did'nt work. After your answer i try again but still no luck.
            I read a patch for managing context on sourceforge http://sourceforge.net/tracker/index.php?func=detail&aid=986585&group_id=22866&atid=376687. Is it related ?

            Thanks,

            • 3. Re: How to disable session persistence ?
              pcolagrosso

              Hi

              I wasn't aware of this add-on patch related to context management for JBoss 3.2.5. Thanks for pointing this out, I'll look into it.

              From the looks of it, the package makes it possible to configure the context per web app (as opposed to just for the default Tomcat context).

              What I'm not clear on is whether configuration of the default Tomcat context should work 'out of the box' for JBOSS 3.2.X or whether this add-on patch is also necessary. Does anyone have any info on this?

              Cheers,

              Piero