1. 程式人生 > >No Spring Session store is configured: set the 'spring.session.store-type'

No Spring Session store is configured: set the 'spring.session.store-type'

發現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配置:

spring.redis.database=0
spring.redis.host=localhost
spring.redis.password=
spring.redis.pool.max-active=8
spring.redis.pool.max-idle=8
spring.redis.pool.max-wait=-1
spring.redis.pool.min-idle=0
spring.redis.port=6379