Tomcat配置session共享遇到的坑

Posted 波子汽水yeah

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Tomcat配置session共享遇到的坑相关的知识,希望对你有一定的参考价值。

异常信息

2020-09-11 16:20:15  ERROR org.springframework.boot.SpringApplication:858 - Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.NoClassDefFoundError: org/apache/tomcat/util/http/mapper/Mapper
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:157)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
        at com.topsports.member.h5.start.H5Application.main(H5Application.java:23)
Caused by: java.lang.NoClassDefFoundError: org/apache/tomcat/util/http/mapper/Mapper
        at org.apache.catalina.connector.Connector.<init>(Connector.java:233)
        at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:170)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:181)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:154)
        ... 8 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.http.mapper.Mapper
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 12 common frames omitted

org.apache.tomcat.util.http.mapper.Mapper所在的包

<dependency>
	<groupId>org.apache.tomcat</groupId>
	<artifactId>tomcat-coyote</artifactId>
	<version>7.0.96</version>
</dependency>
<!-- Thanks for using https://jar-download.com -->

参考

以上是关于Tomcat配置session共享遇到的坑的主要内容,如果未能解决你的问题,请参考以下文章

Tomcat自带的Session共享方案实施记录

IDEA多个项目放在一个tomcat运行,并且多个项目共享session信息

tomcat-session 共享

nginxnginx tomcat session 共享配置

负载均衡下 tomcat session 共享

同一tomcat下session共享