1.如果自己的pom.xml配置文件当中有这个依赖:spring-session依赖,将其注释掉即可。
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>
2.error:
Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class path resource
3.error的原因是:
原因是spring-session调用了CONFIG命令来配置Keyspace notifications功能。而线上环境的redis基于权限的考虑,禁止应用服务执行CONFIG命令,这样就导致了应用在初始化时抛出此异常。
解决方案:
(1)注释掉上面第一点中的依赖。