记一次tomcat7报错

背景

博主时隔多年,再次进行java的开发,本地环境为jdk1.8+IDEA+tomcat7+maven3.6,检出公司项目,运行报错,艰难排之

报错信息

ERROR 2019-03-06 09:31:23o.s.w.c.ContextLoaderContext initialization failed
org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'springSecurityFilterChain' defined in class 
org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration: 
Bean instantiation via factory method failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: 
Factory method 'springSecurityFilterChain' threw exception; nested exception is 
java.lang.IllegalStateException: HttpServletRequest.changeSessionId is undefined. 
Are you using a Servlet 3.1+ environment?

搜索引擎限制了长度,所以博主只能一段一段的百度,试图找到相同遭遇的道友,奈何前面的一大坨都没有找到相似的,最后Are you using a Servlet 3.1+ environment?这段找到了一些信息

记一次tomcat7报错

博主一想,有些道理,可能真是自己的tomcat太过老旧,遂安装最新9.0,运行,成功。。。。。

总结

内在原因在截图中已经描述了,看来软件还是用最新的比较好