Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring Security OAuth2安装程序-无法找到OAuth2命名空间处理程序_Spring_Spring Security_Oauth 2.0_Xml Namespaces - Fatal编程技术网

Spring Security OAuth2安装程序-无法找到OAuth2命名空间处理程序

Spring Security OAuth2安装程序-无法找到OAuth2命名空间处理程序,spring,spring-security,oauth-2.0,xml-namespaces,Spring,Spring Security,Oauth 2.0,Xml Namespaces,我正在尝试使用spring security为OAuth2设置REST服务器。(服务器已经支持没有OAuth的spring安全性)。现在,我尝试遵循Sparkr示例,将spring security oauth工件添加到我的maven中(mvn dependency:tree显示它可用),并将命名空间配置添加到我的spring-security-context.xml中,但我得到的只是: Unable to locate Spring NamespaceHandler for XML schem

我正在尝试使用spring security为OAuth2设置REST服务器。(服务器已经支持没有OAuth的spring安全性)。现在,我尝试遵循Sparkr示例,将spring security oauth工件添加到我的maven中(mvn dependency:tree显示它可用),并将命名空间配置添加到我的spring-security-context.xml中,但我得到的只是:

Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security/oauth2]
浏览至
http://www.springframework.org/schema/security/
我看到的只是.xsd文件,但没有oauth2文件夹。。这怎么可能?我假设Sparkr示例是一个工作版本,那么我做错了什么

以下是我的spring安全上下文标题:

<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">

如果需要,以下是maven设置:

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

org.springframework.security.oauth
春季安全oauth
1.0.0.RC2

您引用了OAuth2,但导入了OAuth1。将依赖项替换为

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

org.springframework.security.oauth
spring-security-oauth2
1.0.0.1版本

您需要确保类路径中存在spring-security-oauth2 jar,并且它可以工作

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

org.springframework.security.oauth
spring-security-oauth2
2.4.0.1发布

Aww见鬼,为什么在无休止的搜索后发布一个问题后,你只需再搜索一次就可以找到答案?!刚在找到,不过还是要谢谢你;)更新: