Spring Boot之No session repository could be auto-configured, check your configuration问题解决

   在启动过程中,出现了如下错误信息:

  1. 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 session repository could be auto-configured, check your configuration (session store type is 'null')  [html]
  2.  view plai

在网上搜了搜:下面是网上的解释:

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

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

    spring.session.store-type=none 

重启后错误消失:

2018-04-08 11:20:36.381  INFO 5052 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
springboot启动完成!
2018-04-08 11:20:36.388  INFO 5052 --- [           main] com.hdys.www.HdApplication  [html] view plai

猜你喜欢

转载自blog.csdn.net/carrybest/article/details/79849460
今日推荐