【发布时间】:2012-04-11 10:32:27
【问题描述】:
我正在使用 spring-security-oauth-1.0.0.M3 使用 spring-security 3.0 和 oauth2 的应用程序。它工作正常。但看起来迁移到 spring-security 3.1 并非易事。我一直无法确认是否仍然支持 oauth 模块。
例如,oauth 教程提到 3.0 而不是 3.1:
https://github.com/SpringSource/spring-security-oauth/wiki/tutorial
当我尝试使用 spring-security-oauth 1.0.0.M3 或 M4 直接升级到 3.1 时,我在以下讨论中遇到了类似于 2012 年 3 月 4 日评论的问题:
http://code.google.com/p/spring-security-social/wiki/Usage
具体来说,我在 Tomcat 日志中看到了这一点:
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration
problem: Failed to import bean definitions from URL location ...
Offending resource: class path resource [spring/applicationContext.xml]; nested
exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected
exception parsing XML document from URL ...; nested exception is
org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class
[org.springframework.security.oauth2.config.OAuth2SecurityNamespaceHandler] for namespace
[http://www.springframework.org/schema/security/oauth2]: problem with handler class file or
dependent class; nested exception is java.lang.NoClassDefFoundError:
org/springframework/security/web/util/AntUrlPathMatcher
有人可以提出上述问题的解决方案,或者指出使用 spring-security 3.1 和 spring-security-oauth 的参考,或者建议使用 spring-security 3.1 实现 oauth2 的更好替代方案?
或者,如果我错过了 spring-security 3.1 的一个基本点,那么了解这也很有用。
谢谢!
【问题讨论】:
-
答案是肯定的,支持。叹了口气,原来 Spring Security 3.1 需要(或至少足够)Spring Security OAuth 1.0.0.M6:forum.springsource.org/… 这解决了上述 BeanDefinitionParsingException。