4
votes

How can I turn off session persistence for geronimo? Is this something I should be doing? - I have no use for persisted sessions in my application. (This is because I recieve a not serializable error in my console, but I do not wish to serialize)

2
no answers yet - anyone?Mark W
I have found this link for WAS which is similar to geronimo. publib.boulder.ibm.com/wasce/V2.1.1/en/…Mark W

2 Answers

7
votes

It depends upon which web container you're using within Geronimo; both Tomcat and Jetty are supported.

Tomcat
Add a context.xml file to your application or add these nodes:

<Context><Manager className="org.apache.catalina.session.StandardManager"
  pathname=""></Manager></Context>

From the tomcat docs for pathname: Restart persistence may be disabled by setting this attribute to an empty string.

The properties are explained at these links:
https://cwiki.apache.org/GMOxDOC22/configuring-session-manager-of-tomcat.html
http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html#Standard_Implementation

Jetty
This container does not persist sessions by default, so there there is nothing to do except to make sure that the SessionHandler is not enabled. Remove the sessionHandler node if it exists in your context configuration.

<Set name="sessionHandler">
<New class="org.eclipse.jetty.servlet.SessionHandler">
  <Arg>
    <New class="org.eclipse.jetty.servlet.HashSessionManager">
      <Set name="storeDirectory">your/chosen/directory/goes/here</Set>
    </New>
  </Arg>
</New></Set>

Informational link:
http://wiki.eclipse.org/Jetty/Howto/Persisting_Sessions

1
votes

The solution for tomcat is depicted in http://www.unicon.net/node/608 and it works like a charm for us. But I don't know if this also applies to geronimo since we are not using it.