`

Are you using a Servlet 3.1+ environment?

 
阅读更多

严重: 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 'springSecurityFilterChain' defined in class org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public javax.servlet.Filter org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.springSecurityFilterChain() throws java.lang.Exception] threw exception; nested exception is java.lang.IllegalStateException: HttpServletRequest.changeSessionId is undefined. Are you using a Servlet 3.1+ environment?

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)

at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5097)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5615)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)

at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public javax.servlet.Filter org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.springSecurityFilterChain() throws java.lang.Exception] threw exception; nested exception is java.lang.IllegalStateException: HttpServletRequest.changeSessionId is undefined. Are you using a Servlet 3.1+ environment?

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188)

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586)

... 27 more

Caused by: java.lang.IllegalStateException: HttpServletRequest.changeSessionId is undefined. Are you using a Servlet 3.1+ environment?

at org.springframework.security.web.authentication.session.ChangeSessionIdAuthenticationStrategy.<init>(ChangeSessionIdAuthenticationStrategy.java:38)

at org.springframework.security.config.annotation.web.configurers.SessionManagementConfigurer$SessionFixationConfigurer.changeSessionId(SessionManagementConfigurer.java:263)

at web.config.SpringSecurityConfig.configure(SpringSecurityConfig.java:90)

at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.getHttp(WebSecurityConfigurerAdapter.java:199)

at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.init(WebSecurityConfigurerAdapter.java:283)

at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.init(WebSecurityConfigurerAdapter.java:68)

at web.config.SpringSecurityConfig$$EnhancerBySpringCGLIB$$7129f72b.init(<generated>)

at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.init(AbstractConfiguredSecurityBuilder.java:367)

at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:320)

at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:39)

at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.springSecurityFilterChain(WebSecurityConfiguration.java:92)

at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$35a3eb18.CGLIB$springSecurityFilterChain$0(<generated>)

at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$35a3eb18$$FastClassBySpringCGLIB$$1cb21f83.invoke(<generated>)

at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)

at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312)

at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$35a3eb18.springSecurityFilterChain(<generated>)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166)

... 28 more

 

 

原因是:javax.servlet-api的版本是3.1,Java的版本是8.0.xx,而tomcat的版本是7.0.X,

但tomcat与servlet版本和java版本有严格的对应关系的。

 

Servlet SpecJSP SpecEL SpecWebSocket SpecApache Tomcat versionActual release revisionSupport Java Versions
4.0 TBD (2.4?) TBD (3.1?) TBD (1.2?) 9.0.x None 8 and later
3.1 2.3 3.0 1.1 8.0.x 8.0.23 7 and later
3.0 2.2 2.2 1.1 7.0.x 7.0.62 6 and later
(WebSocket 1.1 requires 7 or later)
2.5 2.1 2.1 N/A 6.0.x 6.0.44 5 and later
2.4 2.0 N/A N/A 5.5.x (archived) 5.5.36 (archived) 1.4 and later
2.3 1.2 N/A N/A 4.1.x (archived) 4.1.40 (archived) 1.3 and later
2.2 1.1 N/A N/A 3.3.x (archived) 3.3.2 (archived) 1.1 and later

 

所以,可以看出tomcat与java,servlet的版本不对应。

将tomcat版本换成8.0版本的,该错误提示就不再出现了

分享到:
评论

相关推荐

    Java Web+Servlet+Ajax+MySQL的企业信息管理系统

    基于 Java Web+JavaScript+JavaBean+Servlet+Ajax的企业信息管理系统.采用MySQL数据库.是很有价值的J2EE学习的入门案例分析-Based on Java Web+ JavaScript+ JavaBean+ Servlet+ Ajax for enterprise information ...

    CursoAspNetCoreUdemy:Asp.Net Core 2.2 e 3.1 + Entity Framework e Identity归零

    Asp.Net Core 3.1课程(从2.2开始)-从零到忍者 您想了解我们的项目吗? 在Udemy访问该课程: 。 针对CSRF攻击的全局验证,防止在行动中失踪; using Cooperchip . ITDeveloper . Mvc . Extentions . Filters ; ...

    jqueryUI工具类库

    Welcome to jQuery UI! This page demonstrates the widgets you downloaded using the theme you selected in the ... Please make sure you are using jQuery 1.3+ in your production environment. YOUR COMPONENTS:

    《Beginning Python:Using Python 2.6 and Python 3.1》PDF

    《 Beginning Python:Using Python 2.6 and Python 3.1》是一本旨在引导初学者入门Python编程语言的书籍,特别关注Python 2.6和3.1这两个版本。这本书涵盖了从基本语法到高级概念的广泛主题,为读者提供了一个全面...

    Object-Oriented+Data+Structures+Using+Java,+4th+Edition-(2016).pdf

    Welcome to the fourth edition ofObject-Oriented Data Structures Using Java™. This book pres- entsthealgorithmic,programming,andstructuringtechniquesofatraditionaldatastructures course in an object-...

    20 Python Libraries You Aren't Using 无水印pdf

    20 Python Libraries You Aren't Using 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请...

    jquery-ui文档.rar

    Welcome to jQuery UI! This page demonstrates the widgets you downloaded using the theme you selected in the download builder... Please make sure you are using jQuery 1.3+ in your production environment.

    Car Paint - Pro 3.1

    ▲ [IMPORTANT] Shaders are optimized for mobile, but example scenes are using Image Effects which may not work on mobile devices Each element has been carefully crafted, with in-game use optimization...

    Beginning Python Using Python2.6 and Python3.1

    ### 关于《Beginning Python: Using Python 2.6 and Python 3.1》的知识点解析 #### 一、概述 本书《Beginning Python: Using Python 2.6 and Python 3.1》是一本面向初学者的Python编程入门书籍,旨在帮助读者...

    ERROR CODE: 1175 YOU ARE USING SAFE UPDATE MODE AN

    You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column 进过一番搜索之后发现原来是MySQL Workbench的安全设置。当要执行的SQL语句是进行批量更新或者删除的时候...

    Beginning Python Using Python 2.6 and Python 3.1

    ### 关于《Beginning Python: Using Python 2.6 and Python 3.1》的知识点解析 #### 第一部分:初识Python **第1章:编程基础与字符串** 本章介绍了编程的基本概念,如变量、数据类型等,并着重讲解了字符串处理...

    Beginning Python:Using Python 2.6 and Python 3.1-628页

    "Beginning Python:Using Python 2.6 and Python 3.1-628页" 本书籍《Beginning Python:Using Python 2.6 and Python 3.1》是Python语言的入门书籍,对于初学者和中级开发者都非常适用。该书籍涵盖了Python语言的...

    servlet2.4doc

    A filter is an object that performs filtering tasks on either the request to a resource (a servlet or static content), or on the response from a resource, or both. Filters perform filtering in the ...

    NPOI.2.1.3.1.zip

    NPOI.2.1.3.1.zip是一个包含NPOI库特定版本(2.1.3.1)的压缩包,可能包含了用于项目开发所需的DLL文件和其他相关资源。 在.NET开发中,DLL(动态链接库)文件是包含可重用代码的库,可以被多个应用程序共享。NPOI....

    Beginning Python:Using Python 2.6 and Python 3.1

    ### 关于《Beginning Python:使用Python 2.6和Python 3.1》的知识点解析 #### 一、概述 本书《Beginning Python:使用Python 2.6和Python 3.1》是一本旨在帮助读者从零开始学习Python编程语言的基础书籍。作者...

    AIM Advantage 3.1

    What other methods and tools are integrated with AIM 3.1? AIM 3.1 is closely integrated with Oracle's Project Management Method (PJM). AIM and PJM tasks are both reflected in the AIM Work Breakdown ...

    Hibernate Reference Documentation3.1

    9.1.3. Table per subclass, using a discriminator 9.1.4. Mixing table per class hierarchy with table per subclass 9.1.5. Table per concrete class 9.1.6. Table per concrete class, using implicit ...

    Beginning Python:Using Python 2.6 and Python 3.1.pdf

    《Beginning Python:Using Python 2.6 and Python 3.1》是一本专注于Python编程语言的入门书籍,由James Payne所著,由Wiley Publishing, Inc.出版。这本书旨在帮助读者快速掌握Python编程基础,并介绍了Python 2.6...

Global site tag (gtag.js) - Google Analytics