【发布时间】:2018-12-29 05:36:09
【问题描述】:
我正在尝试将项目从 Spring 4.3 升级到 5.0,但遇到了 Spring Security OAuth 中似乎存在的问题。特别是一堆嵌套bean创建失败的形式:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'oauth2EndpointHandlerMapping' defined in class path resource [org/springframework/security/oauth2/config/annotation/web/configuration/AuthorizationServerEndpointsConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/web/method/HandlerMethodSelector
...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'oauth2EndpointHandlerMapping' defined in class path resource [org/springframework/security/oauth2/config/annotation/web/configuration/AuthorizationServerEndpointsConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/web/method/HandlerMethodSelector
...
Caused by: java.lang.NoClassDefFoundError: org/springframework/web/method/HandlerMethodSelector
似乎 org.springframework.web.method.HandlerMethodSelector 在较晚的 Spring 4.x 版本中被弃用,然后在 Spring 5.x 中被完全删除。
我试图一起工作的实际版本是:
- Spring 框架:5.0.6
- Spring 安全性:5.0.6
- Spring Security OAuth:2.3.3
Spring Security OAuth 版本是最新的,所以我不确定下一步该去哪里。是否没有与 Spring 5.x 兼容的版本?如果是这样,我有什么选择?
【问题讨论】:
-
解决这个问题好运吗?
-
不,@TerNovi。自从发帖以来,我一直被转移到其他工作上。但我最终会回到这项工作,如果我取得任何进展,我会发布更新。
标签: spring spring-security spring-security-oauth2