Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/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 Spring安全性注销异常_Spring Security - Fatal编程技术网

Spring security Spring安全性注销异常

Spring security Spring安全性注销异常,spring-security,Spring Security,当我将SpringSecurity3配置为注销用户时,会出现一个巨大的错误 线程“http-bio-8080”-exec-7”java.lang.StackOverflower中出现异常错误 位于com.dc.api.model.Users.getUsername(Users.java:200) Users.java:200映射到org.springframework.security.core.userdetails.userdetails实现方法 public String getUsern

当我将SpringSecurity3配置为注销用户时,会出现一个巨大的错误

线程“http-bio-8080”-exec-7”java.lang.StackOverflower中出现异常错误 位于com.dc.api.model.Users.getUsername(Users.java:200)

Users.java:200
映射到
org.springframework.security.core.userdetails.userdetails
实现方法

public String getUsername() {
    return this.getUsername();
}
public String getUsername() {
    return this.getUsername();
}
注销链接:

<a href="${facesContext.externalContext.requestContextPath}/j_spring_security_logout.html">
log out</a>

spring安全配置:

 <logout invalidate-session="true" 
          logout-success-url="/" 
          logout-url="/j_spring_security_logout.html"/>

web.xml


我已经将
springSecurityFilterChain
配置为在
*.html
*.xhtml

的任何转发或请求上运行。这里的问题是spring security调用的以下方法正在调用自己,并且处于无限循环中。它应该调用我的用户模型对象的userId(
this.getUserId