tomcat中的弹簧警告输出“无法创建会话” [英] Spring warning output in tomcat "Failed to create a session"

查看:216
本文介绍了tomcat中的弹簧警告输出“无法创建会话”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

2011-01-25 / 23:30:06.856 / EST [http-80- exec-1] WARN由于已提交响应,因此无法创建会话。无法存储SecurityContext。

2011-01-25 / 23:30:09.597 / EST [http-80 -exec-3] WARN身份验证事件InteractiveAuthenticationSuccessEvent:email@domain.com;详细信息:org.springframework.security.web.authentication.WebAuthenticationDetails@957e:RemoteIpAddress:170.9.26.16; SessionId:null

我正在运行 spring 3 tomcat 6 春季安全3

我根据这些信息重新配置了以下bean(来自此处):

I reconfigured the following bean based on the this info (from here):


create-session

create-session

控制创建HTTP会话的渴望程度。如果未设置,则默认为ifRequired。其他选项是永远和从不。此属性的设置会影响HttpSessionContextIntegrationFilter的allowSessionCreation和forceEagerSessionCreation属性。除非将此属性设置为never,否则allowSessionCreation将始终为true。 forceEagerSessionCreation为false,除非它设置为always。因此,默认配置允许创建会话,但不强制它。例外情况是,如果启用了并发会话控制,则​​forceEagerSessionCreation将设置为true,而不管此处的设置是什么。使用never会在HttpSessionContextIntegrationFilter初始化期间导致异常。

Controls the eagerness with which an HTTP session is created. If not set, defaults to "ifRequired". Other options are "always" and "never". The setting of this attribute affect the allowSessionCreation and forceEagerSessionCreation properties of HttpSessionContextIntegrationFilter. allowSessionCreation will always be true unless this attribute is set to "never". forceEagerSessionCreation is "false" unless it is set to "always". So the default configuration allows session creation but does not force it. The exception is if concurrent session control is enabled, when forceEagerSessionCreation will be set to true, regardless of what the setting is here. Using "never" would then cause an exception during the initialization of HttpSessionContextIntegrationFilter.



<bean id="httpSessionContextIntegrationFilter" class="org.springframework.security.web.context.HttpSessionContextIntegrationFilter">
    <property name="allowSessionCreation" value="false"/>
</bean>


推荐答案

将以下内容添加到您的配置中:http session-creation ='never'>
更多关于Spring论坛: http://forum.springsource .org / showthread.php?t = 82196

Add the following to your config: http session-creation='never'> More on Spring forum: http://forum.springsource.org/showthread.php?t=82196

这篇关于tomcat中的弹簧警告输出“无法创建会话”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆