In my case, I had this stackoverflow due to the missing of @Service at UserDetailsService implementation:
2025-03-26T13:52:17.882-03:00 ERROR 14543 --- [image-processor-api] [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed: java.lang.StackOverflowError] with root cause
java.lang.StackOverflowError: null
at java.base/java.lang.Exception.<init>(Exception.java:103) ~[na:na]
at java.base/java.lang.ReflectiveOperationException.<init>(ReflectiveOperationException.java:90) ~[na:na]
at java.base/java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:67) ~[na:na]
@Service
public class UserDetailsServiceImpl implements UserDetailsService {
I'd put it and problem solved :D