[英]Spring Security 4 Cannot create bean FilterChain on Tomcat 7
A project which I downloaded from a repository fails to run on Apache Tomcat 7. It is a Spring 4.1.6 application with Spring security 4.0.1 and OpenAM version 10.0.0. 我从存储库下载的项目无法在Apache Tomcat 7上运行。这是具有Spring安全性4.0.1和OpenAM版本10.0.0的Spring 4.1.6应用程序。 The run process fails on my local Apache Tomcat 7 instance with an error stating
运行过程在本地Apache Tomcat 7实例上失败,并显示错误消息
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains':
...
The nested exception is 嵌套的异常是
org.springframework.beans.BeanInstantiationException: Could not instantiate bean class
[org.springframework.security.web.authentication.session.ChangeSessionIdAuthenticationStrategy]: Constructor threw exception;
nested exception is java.lang.IllegalStateException: HttpServletRequest.changeSessionId is undefined. Are you using a Servlet 3.1+ environment?
The pom.xml file is set up with pom.xml文件设置为
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
I know this is a build environment configuration issue because the source code has been run successfully on another machine. 我知道这是一个构建环境配置问题,因为源代码已在另一台计算机上成功运行。 What needs to change to get the filterChains bean to be created successfully
要成功创建filterChains bean需要进行哪些更改
The key thing to note in the log was the: 日志中要注意的关键是:
HttpServletRequest.changeSessionId is undefined.
HttpServletRequest.changeSessionId未定义。 Are you using a Servlet 3.1+ environment?
您正在使用Servlet 3.1+环境吗?
By upgrading to Tomcat 8 and using Java EE 7 Web, I was able to get the project to run successfully. 通过升级到Tomcat 8并使用Java EE 7 Web,我能够使项目成功运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.