Products
Clients
Extensions
APIs
This example demonstrates how to set-up and use VMware GemFire's Session Management Module for Tomcat.
This example assumes you have GemFire and Java installed. It also assumes you have local copy of Tomcat Downloaded. It was designed and tested with GemFire 1.9.0 and Tomcat 9, and while the session features will work with other combinations you may need to make some changes to the setup if you’re using other versions. For more information about how to set up the tomcat module with your version of Tomcat and GemFire see the official documentation.
##Steps
Set the environment Variable $CATALINA_HOME to point at the root directory of your local Tomcat installation. This is a Tomcat convention, so in some cases this may have already been set.
Find the configuration files located at $CATALINA_HOME/conf/. To the server.xml file add the line:
<Listener className="org.apache.geode.modules.session.catalina.ClientServerCacheLifecycleListener"/>
and to the file context.xml add the line:
<Manager className="org.apache.geode.modules.session.catalina.Tomcat9DeltaSessionManager"/>
cd scripts ./example-setup.sh <root directory of GemFire install>
Specify the root directory of your local GemFire installation. Make sure you have no local GemFire cluster running, as this step will start a new local cluster to manage our Session States. This can be done by running gfsh from your GemFire installation and running a connect command with no parameters. If a cluster is found, use the shutdown command to stop the cluster before continuing.
connect
localhost:8080/SessionStateDemo/index