简体   繁体   中英

Tomcat 7 with Memcached Session Manager

We are setting up Tomcat 7 clusters and we need to use Memcached Session Manager to manage the session among multiple Tomcat 7 instances.

I have included the following 2 jar files into "/usr/share/tomcat7/lib/": memcached-2.5.jar memcached-session-manager-tc7-1.6.5.jar

And updated server.xml by including this:

<Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
<Context path="" reloadable="true" docBase="/var/lib/tomcat7/webapps/ROOT/">
        <Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager" 
        memcachedNodes="n1:localhost:11211" sticky="false" lockingMode="all"
                    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$" 
        transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFactory" />
    </Context>
    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
    prefix="localhost_access_log." suffix=".txt"
            pattern="%h %l %u %t &quot;%r&quot; %s %b" />

However, every time I tried to start the tomcat instance, I get this error:

java.lang.NoClassDefFoundError: de/javakaffee/web/msm/MemcachedSessionService$SessionManager at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

Anyone can shed some light on which part has gone wrong will be very much appreciated.

Many thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM