scope='request'的bean预加载冲突
来源:互联网 发布:深圳善达网络怎么样 编辑:程序博客网 时间:2024/06/01 18:49
Error creating bean with name ‘authenticationSuccessServlet’: Scope ‘request’ is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton;
情景:
我自定义了一个spring security中的AuthenticationSuccessHandle类
并在spring security中配置authentication-success-handler-ref
目的是在spring security认证完用户了之后调用自定义的AuthenticationSuccessHandle类中的方法,我想在Session中存放认证用户的id
自定义的AuthenticationSuccessHandle类,我在spring中配置的scope是request
问题描述:
这个scope为request的bean不能被当前线程调用,请将scope改成singleton
原因:
我在网上查到原因是,spring security需要在启动的时候就加载AuthenticationSuccessHandle类,然而spring只在有请求的时候才加载这个类,所以spring security就加载不到
解决方案:
将这个bean的scope改成singleton
0 0
- scope='request'的bean预加载冲突
- 《转》详解Spring中bean的scope singleton prototype request...
- Bean的scope
- Spring Bean的Scope
- bean的scope属性
- bean的scope属性
- bean的scope属性
- spring bean的scope
- Spring Bean的Scope
- Spring Bean的scope
- spring bean的scope
- spring之bean的Scope
- spring中bean的scope
- Spring中Bean的Scope
- spring bean的scope属性
- spring bean的scope属性
- spring bean的scope属性
- spring中bean的scope
- C语言单链表实现19个功能完全详解
- MySQL数据库存储引擎
- C++的类
- 利用TabLayout(5.0新技术)+ViewPager+Fragment方法实现书签导航
- Mysql中LAST_INSERT_ID()的函数使用详解
- scope='request'的bean预加载冲突
- 窥探PTAM之基础知识准备
- win32多国语言编程setlocale
- Objective-C Coding Style Guidelines
- OSG拖拽器简介与示例
- 【SSH网上商城项目实战23】完成在线支付功能
- 版本控制:集中式VS分布式
- 进击的设计模式 - 目录
- OC 结构体的应用