美文网首页
关于redis session报错

关于redis session报错

作者: Bruce唐 | 来源:发表于2017-07-13 11:50 被阅读0次

昨天在对项目进行codis替换成redis时发生了一个错误,错误信息如下:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.session.SessionAutoConfiguration$SessionRepositoryValidator': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No Spring Session store is configured: set the 'spring.session.store-type' property

因为之前的codis使用了@EnableRedisHttpSession(maxInactiveIntervalInSeconds =86400)注解,替换成redis之后并没有添加该注解,导致了启动的时候报错,但是在属性文件中添加spring.session.store-type=none,启动不报错了,但是redis少了很多key值。所以后面还是加了一个类将@EnableRedisHttpSession(maxInactiveIntervalInSeconds =86400)以及@Configuration注解加上,这才没有报错。

相关文章

网友评论

      本文标题:关于redis session报错

      本文链接:https://www.haomeiwen.com/subject/abkwhxtx.html