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配置

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

  • 相关阅读:
    how to uninstall devkit
    asp.net中bin目录下的 dll.refresh文件
    查找2个分支的共同父节点
    Three ways to do WCF instance management
    WCF Concurrency (Single, Multiple, and Reentrant) and Throttling
    检查string是否为double
    How to hide TabPage from TabControl
    获取当前系统中的时区
    git svn cygwin_exception
    lodoop打印控制具体解释
  • 原文地址:https://www.cnblogs.com/xk920/p/10649488.html
Copyright © 2011-2022 走看看