【spring-session】错误:No bean named 'springSessionRepositoryFilter' available
前言
- spring-session 2.0.2.RELEASE
- 安装官方文档配置可以正常启动。
- 自己改动了一下,就出现了错误:No bean named ‘springSessionRepositoryFilter’ available
错误内容
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSessionRepositoryFilter' available
问题分析
项目是spring mvc的servlet3.0项目,使用注解配置。
使用@EnableRedisHttpSession
注解开启spring session 功能,启动项目正常。
不通过注解,而是通过实例化Bean RedisHttpSessionConfiguration就出现上述错误。
经过分析,是因为在RedisHttpSessionConfiguration中应该被实例化的Bean RedisOperationsSessionRepository未被实例化。
看来只能通过@EnableRedisHttpSession
注解开启spring session 功能了。
我只是想修改maxInactiveIntervalInSeconds参数。使用@EnableRedisHttpSession
注解后,改用下面的方式修改maxInactiveIntervalInSeconds参数。
@Configurationstatic class RedisHttpSessionConfigurationConfiguration {@Autowiredpublic void setRedisHttpSessionConfiguration(RedisHttpSessionConfiguration config,@Value("${redis.session.timeout}") int maxInactiveIntervalInSeconds) {config.setMaxInactiveIntervalInSeconds(maxInactiveIntervalInSeconds);}}
【spring-session】错误:No bean named 'springSessionRepositoryFilter' available相关推荐
- yan-master项目启动报错No bean named 'springSessionRepositoryFilter' is defined
spring redis session 报错的问题 原因:spring-redis.xml文件被删除 解决方法:删除web.xml或者恢复被删除的redis配置文件即可
- bean named 'entityManagerFactory' that could not be found错误及解决
问题: 在Eclipse下报如下错误:bean named 'entityManagerFactory' that could not be found. 发生场景: 导入JPA依赖包后, 在Serv ...
- 关于spring boot的Bean named ‘aaa‘ is expected to be of type ‘bbb‘ but was actually of type ‘bbb‘问题的解决方案
相信后端的同学在平时开发时都大多都使用到spring boot来开发,那么在使用bean工厂注册bean时说不定会遇到过Bean named 'aaa' is expected to be of ty ...
- Bean named XXX is expected to be of type XXX but was actually of type 'com.sun.proxy.$Proxy28'
现象 运行Spring Web程序时报出错误 BeanNotOfRequiredTypeException: Bean named 'loginLogService' is expected to b ...
- Spring错误之org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named ‘bookService‘
1 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'c ...
- spring中No bean named xxx available错误
我这边是采用spring注解来做的. ApplicationContext context = new AnnotationConfigApplicationContext(配置类.class);填写 ...
- 解决spring boot shiro的 Consider defining a bean named ‘shiroFilterFactoryBean‘ in your configuration问题
文章目录 1. 复现问题 2. 分析问题 3. 解决问题 1. 复现问题 今天在启动spring boot项目时.出现了如下错误: 具体错误信息如下: Description:Method filte ...
- Spring Boot——Spring Session Redis整合Spring Security时错误【RedisConnectionFactory is required】解决方案
问题描述 异常栈栈底 Caused by: java.lang.IllegalStateException: RedisConnectionFactory is requiredat org.spri ...
- SpringMVC莫名其妙出现No bean named 'cacheManager' is defined错误
2019独角兽企业重金招聘Python工程师标准>>> 在使用Interiij idea创建SpringMVC项目时,莫名其妙出现了No bean named 'cacheManag ...
最新文章
- 求助!妹子一个rm -rf把公司服务器数据删没了,我该怎么办?
- CentOS装LAMP服务器(Apache2+PHP5+MySQL)
- 记录一下vlfeat视觉库配置
- mybatis之一对多
- python的爬虫库_python做爬虫常用库
- 【Node】node启动过程
- 建模心法(2)——迈出建模第一步
- ciclop读音,购机必备,15种 3D扫描 设备 优缺点汇总
- linux服务器搭建_基于LINUX系统的邮件服务器搭建和详细部署(POSTFIX)
- 【算法学习笔记】85.破环为链 序列DP 松弛+代价 SJTU OJ 1073 能量项链
- FreeMarker MyEclipse IDE
- Camtasia实用技巧之智能聚焦
- thinkphp5 数据库 链接 Connection
- Java中定时任务的6种实现方式,你知道几种?
- 海思移动侦测和视频遮挡实现
- Windows2012开机启动项设置
- 年仅 28 岁就宣布从字节跳动退休?
- c++_2: 类的定义
- 封神榜中的截教教徒是如何被杀的----开篇
- 怎么把PDF文件转换成Word?三招教你轻松搞定
热门文章
- BZOJ 4070 [Apio2015]雅加达的摩天楼 ——分块 SPFA
- 数据的中心化和标准化
- WebKit.NET-0.5简单应用
- sqlserver 2012 查询时提示“目录名称无效”
- Druid 配置_DruidDataSource参考配置
- ASP.NET MVC 使用 FluentScheduler 定时器计划任务
- Failed to create the Java Virtual Machine
- 大型软件公司.Net面试题(二)
- ELK日志分析平台搭建全过程(自己做了测试,测试不完整因为原文章都是图片)
- php 实现进制相互转换