2013-01-03 85 views
2

我正尝试使用spring-security为OAuth2设置我们的REST服务器。 (服务器已经支持没有OAuth的spring-security)。现在我试着按照sparklr的例子,并将spring-security-oauth工件添加到我的maven(mvn dependency:树显示它可用)以及命名空间配置到我的spring-security-context.xml中,但我得到的是:Spring-Security OAuth2安装程序 - 无法找到oauth2名称空间处理程序

Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security/oauth2] 

浏览到http://www.springframework.org/schema/security/所有我看到的是xsd文件,但没有文件夹的oauth2 ..这怎么可能呢?我假设sparklr的例子是一个工作版本,所以我做错了什么?

这里是我的春天的安全上下文头:

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oauth="http://www.springframework.org/schema/security/oauth2" 
    xmlns:sec="http://www.springframework.org/schema/security" 
    xsi:schemaLocation=" 
http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd 
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> 

如果需要的话,这里的行家设置:

<dependency> 
     <groupId>org.springframework.security.oauth</groupId> 
     <artifactId>spring-security-oauth</artifactId> 
     <version>1.0.0.RC2</version> 
    </dependency> 
+0

更新:https://www.springframework.org/schema/security/spring-security-oauth2.xsd –

回答

7

你引荐到OAuth2但进口的OAuth 1.更换依赖于

<dependency> 
    <groupId>org.springframework.security.oauth</groupId> 
    <artifactId>spring-security-oauth2</artifactId> 
    <version>1.0.0.RELEASE</version> 
</dependency> 
+0

噢地狱,为什么在无尽搜索之后发布一个问题后,你只做了一次搜索并找到答案?!刚刚在http://forum.springsource.org/showthread.php?121522-quot-Unable-to-locate-Spring-NamespaceHandler-quot-for-OAuth-2-XSD上找到它,但无论如何感谢;) – Pete

相关问题