Java 无法自动配置会话存储库,请检查您的配置(会话存储类型为“空”)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38194650/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
No session repository could be auto-configured, check your configuration (session store type is 'null')
提问by 000
What does this spring boot start up error mean?
这个spring boot启动错误是什么意思?
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')
采纳答案by Stephane Nicoll
You have Spring Session on your classpath and no store was provided. We can't take that decision for you as if your classpath changes, the store type may change according to our preferences and you'd lose them without any sort of warning.
您的类路径上有 Spring Session 并且没有提供商店。我们无法为您做出这个决定,就好像您的类路径发生了变化一样,存储类型可能会根据我们的偏好发生变化,并且您会在没有任何警告的情况下丢失它们。
Historically we only supported redis so if you have that we'll use it transparently. Please set spring.session.store-type
to the store you want to use for Spring Session. If Spring Session is on your classpath and you don't want to use it right now, set spring.session.store-type=none
过去我们只支持 redis,所以如果你有,我们会透明地使用它。请设置spring.session.store-type
为您要用于 Spring Session 的商店。如果 Spring Session 在您的类路径上并且您现在不想使用它,请设置spring.session.store-type=none
Update: given the number of upvotes, this looks like a confusing error message so I've opened #9284to improve it.
更新:考虑到赞成票的数量,这看起来像是一条令人困惑的错误消息,因此我打开了#9284以对其进行改进。