SPECjvm2008_1_01 openjdk8 x86_64 ARM64 运行时长、成绩 Run is valid, but not compliant

青乌

关注

阅读 46

2023-07-28

报错内容 

原因:没有指定userService类

错误地方:

@EnableWebSecurity
public class AuthWebServiceSecurityConfig extends WebSecurityConfigurerAdapter {

    /**
     * 对请求进行鉴权的配置
     */
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                //.antMatchers().permitAll()
                .anyRequest().authenticated()
                .and()
                // 暂时关闭CSRF校验,允许get请求登出
                .csrf().disable();
    }
}

修改:

@EnableWebSecurity
public class AuthWebServiceSecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    private AuthUserDetailsService authUserDetailsService;

    /**
     * 对请求进行鉴权的配置
     */
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.userDetailsService(authUserDetailsService);
        http.authorizeRequests()
                //.antMatchers().permitAll()
                .anyRequest().authenticated()
                .and()
                // 暂时关闭CSRF校验,允许get请求登出
                .csrf().disable();
    }
}

其中 AuthUserDetailsService 为实现了UserDetailsService接口的实现类

精彩评论(0)

0 0 举报