zoukankan      html  css  js  c++  java
  • spring boot session error

    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
    2019-04-03 15:51:32.919 ERROR 7532 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 
    
    ***************************
    APPLICATION FAILED TO START
    ***************************
    
    Description:
    
    Multiple Spring Session store implementations are available on the classpath:
        - org.springframework.session.jdbc.JdbcOperationsSessionRepository
        - org.springframework.session.data.mongo.MongoOperationsSessionRepository

    这种错误也可能是boot版本问题吧,是因为maven依赖中添加了spring-session的依赖,spring session的存储方式就要配置;可能之前代码没有让sping容器来管理session,所以就不会出现类似问题。但是现在就会出这种错误了。

    所以发现session store type使用来存放session的存储方式,目前Spring boot中只支持Redis方式。 由于本应用暂无需将session放入redis的需求,故这里就可以将session store type设置为none.

     这里我们将此配置信息放入application.properites之中:

    # default-store in spring session. it will be set in redis only outside.

    spring.session.store-type=none

    再次启动,成功。

    如果使用redis存储session:

    application.properties配置

    spring.session.store-type=redis

    然后加入相关redis配置

    这里自己做个记录,也希望可以帮到大家。

  • 相关阅读:
    Zookeeper的ZAB协议
    Netty从入门到放弃,从放弃在到入门
    Java多线程-锁的原理
    ContextLoaderListener的说明
    Jdk和Cglib 的区别
    zookeeper核心概念
    https
    [CS Academy] Infinity Array
    [JZOJ 5669] Permutaition
    [CF 613 Div.1E] Puzzle Lover
  • 原文地址:https://www.cnblogs.com/xk920/p/10649488.html
Copyright © 2011-2022 走看看