美文网首页
Redis在Spring-data-session共享中存在的问

Redis在Spring-data-session共享中存在的问

作者: 夜寻 | 来源:发表于2018-07-17 16:09 被阅读0次

    SASS Redis在Spring-data-session共享中存在的问题

    公司使用网易云Redis服务,使用session共享的时候存在一些问题。会报错需要处理

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR unknown command 'CONFIG'
    

    首先在云服务器后台去设置

    网易云Redis后台参数设置

    然后在代码中配置

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:util="http://www.springframework.org/schema/util"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/util
            http://www.springframework.org/schema/util/spring-util.xsd">
    
        <!-- 让Spring Session不再执行config命令 -->
        <util:constant static-field="org.springframework.session.data.redis.config.ConfigureRedisAction.NO_OP"/>
    
    </beans>
        
    

    相关文章

      网友评论

          本文标题:Redis在Spring-data-session共享中存在的问

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