没有会话存储库可以自动配置,检查您的配置(会话存储类型是' null')

时间:2016-07-05 03:05:33

标签: java spring session spring-boot repository

这个春季启动错误是什么意思?

2016-07-04 21:53:53 [restartedMain] ERROR o.s.boot.SpringApplication - Application startup failed    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')

1 个答案:

答案 0 :(得分:65)

你的类路径上有Spring Session,但没有提供商店。我们无法为您做出这样的决定,就好像您的类路径发生变化一样,商店类型可能会根据我们的偏好而改变,并且您会在没有任何警告的情况下丢失它们。

从历史上看,我们只支持redis,所以如果你有,我们将透明地使用它。请将spring.session.store-type设置为要用于Spring Session的商店。如果Spring Session在您的类路径中并且您现在不想使用它,请设置spring.session.store-type=none

更新:根据upvotes的数量,这看起来像一个令人困惑的错误消息,所以我已经打开#9284来改进它。