Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.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 OAuth2资源类_Spring_Spring Security_Oauth 2.0_Spring Security Oauth2 - Fatal编程技术网

未调用Spring OAuth2资源类

未调用Spring OAuth2资源类,spring,spring-security,oauth-2.0,spring-security-oauth2,Spring,Spring Security,Oauth 2.0,Spring Security Oauth2,关于StackOverflow的以下问题,我已经包括了一节课 用@Configuration、@EnableResourceServer和@EnableWebSecurity注释。 代码构建得很好,但是控件不在这个类中运行,这个类已经用前面提到的方法进行了注释 我检查了web.xml中是否禁用了安全过滤器。现在,我已经启用了它们。尽管我在满足请求时没有得到预期的结果,但我认为最初的问题已经解决了。 这个问题已经解决了,但现在我面临另一个问题: HTTP状态500-无法计算表达式“角色\用户”

关于StackOverflow的以下问题,我已经包括了一节课 用@Configuration、@EnableResourceServer和@EnableWebSecurity注释。 代码构建得很好,但是控件不在这个类中运行,这个类已经用前面提到的方法进行了注释


我检查了web.xml中是否禁用了安全过滤器。现在,我已经启用了它们。尽管我在满足请求时没有得到预期的结果,但我认为最初的问题已经解决了。
这个问题已经解决了,但现在我面临另一个问题: HTTP状态500-无法计算表达式“角色\用户” 根本原因:org.springframework.expression.spel.SpelEvaluationException:EL1008E:在类型为“org.springframework.security.web.access.expressionroot”的对象上找不到属性或字段“ROLE\u USER”—可能不是公共的

web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <display-name>hk-pensions</display-name>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:META-INF/spring/*.xml</param-value>
    </context-param>

    <context-param>
        <param-name>defaultHtmlEscape</param-name>
        <param-value>true</param-value>
    </context-param>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/dispatcher-servlet.xml</param-value>
            </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <!-- Spring Security -->
   <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter-mapping>  
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

香港退休金
上下文配置位置
类路径:META-INF/spring/*.xml
默认HTMLescape
真的
org.springframework.web.context.ContextLoaderListener
调度员
org.springframework.web.servlet.DispatcherServlet
上下文配置位置
/WEB-INF/dispatcher-servlet.xml
1.
调度员
/
springSecurityFilterChain
org.springframework.web.filter.DelegatingFilterProxy
springSecurityFilterChain
/*

请发布您迄今为止尝试的内容请发布您的安全配置类my web.xml中禁用了安全筛选器。现在,我已经启用了它们。尽管我在请求时没有得到预期的结果,但我认为最初的问题已经解决了。nw它起作用了吗?该问题已经解决,但现在我面临另一个问题:HTTP状态500-无法计算表达式“ROLE_USER”的值