Tomcat7 and Redis's sessoin sharing problem handling

Source: Internet
Author: User
Tags install redis

1, install Redis and configure and start, Tomcat also do a phase download, other places, can be viewed elsewhere.
2, get the Tomcat dependency package:
Tomcat uses a Redis client that downloads Jedis from Https://github.com/xetorthio/jedis/downloads as Java.
Download the Redis Session Manager plugin for Tomcat from Https://github.com/jcoleman/tomcat-redis-session-manager/downloads
Download Apache common Pool2 package from http://commons.apache.org/proper/commons-pool/download_pool.cgi, 2.2. Copy these jar packages to the tomcat7 Lib directory
Packages are: redis2.8, Jedis.jar, Common-pool2.2.jar, Tomcat-redis-session-manager-1.2-tomcat-7.jar
3 Configuring Tomcat
In Https://github.com/jcoleman/tomcat-redis-session-manager This article sees the configuration as:
<valve classname= "Com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve"/>
<manager classname= "Com.orangefunction.tomcat.redissessions.RedisSessionManager"
host= "localhost" <!--optional:defaults to "localhost"--
Port= "6379" <!--optional:defaults to "6379"-
database= "0" <!--optional:defaults to "0"--
Maxinactiveinterval= <!--optional:defaults to "$" (in seconds)--
sessionpersistpolicies= "Persist_policy_1,persist_policy_2,.." <!--optional-
Sentinelmaster= "Sentinelmastername" <!--optional--
sentinels= "Sentinel-host-1:port,sentinel-host-2:port,.." <!--optional-/>
While the downloaded package Tomcat-redis-session-manager-1.2-tomcat-7-java-7.jar or Tomcat-redis-session-manager-1.2-tomcat-7.jar
There is no class: Com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve
So download the source code directly from Https://github.com/jcoleman/tomcat-redis-session-manager:
found that there are corresponding classes in the source code, while the source (Tomcat-redis-session-manager) relies on the other Tomcat package: Tomcat-juli.jar
And Tomcat does not have these packages by default, from http://mirrors.cnnic.cn/apache/tomcat/tomcat-7/v7.0.57/bin/extras/ Download Tomcat-juli-adapters.jar and Tomcat-juli.jar Two packages, placed in the Apache-tomcat-7.0.57\lib directory.
At the same time will compile Tomcat-redis-session-manager source code, through the corresponding dependency package Common-pool2.2,jedis and Tomcat-juli.jar compile, and play into their own jar package, I have uploaded in:
http://download.csdn.net/detail/qinxcb/8279761
Then put this dependency package in the Apache-tomcat-7.0.57\lib directory and delete the Tomcat-redis-session-manager-1.2-tomcat-7.jar downloaded online.

Tomcat7 and Redis's sessoin sharing problem handling

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.