ali-bouali / spring-boot-3-jwt-security

Sample project on how to implement JWT security based using Spring boot 3 and Spring security 6

Home Page:https://aliboucoding.com/p/securing-your-spring-boot-3-0-applications-with-json-web-tokens-jwt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

filterChain.doFilter() throwing jakarta.servlet.ServletException: Request processing failed: {the real exception}

joel021 opened this issue · comments

doFilter is throwing ServletException when any exception occurs in the controller or service layer instead of the real exception. For example, if a user is duplicated and the service is set to throw ConflictException to be caught by a GlobalExceptionHandler, filterChain.doFilter(request, response) throws "ServletException: Request processing failed: ConflictException" instead of the GlobalExceptionHandler catching it. The GlobalExceptionHandler is supposed to catch that exception. Besides, this failure should not happen when or before perform doFilterInternal(), right?

the error occurs in :
filterChain.doFilter(request, response);
raise-errror