NestedServletException, Handler dispatch failed; nested exception is java.lang.StackOverflowError [Solved]

After setting up the spring security oauth2 environment, conduct interface test with postman:

Postman returned an error message:

The idea console outputs the following warnings:

WARN 4344 — [nio-8082-exec-1] o.s.s.o.provider.endpoint.TokenEndpoint  : Handling error: NestedServletException, Handler dispatch failed; nested exception is java.lang.StackOverflowError

After investigation, it is found that a method in the spring security configuration class securityconfiguration written by myself is wrong and written as: AuthenticationManager. The correct method name should be authenticationmanagerbean.

The complete and correct method is:

@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
      return super.authenticationManagerBean();
}

Retest after modification and return the correct result:

If you encounter any problems during browsing, please leave me a message in the comment area below.


Read More: