Когда я пытаюсь принести APIS в Swagger, получая эту ошибку, когда я разрешил URL и все.
org.springdoc
springdoc-openapi-starter-webmvc-ui
2.5.0
< /code>
@Bean
public SecurityFilterChain securityFilterChain(
org.springframework.security.config.annotation.web.builders
.HttpSecurity http) throws Exception {
http.csrf(csrf -> csrf.disable())
.cors(cors -> cors.configurationSource(corsConfigurationSource()))
.sessionManagement(
sm -> sm.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.exceptionHandling(e
-> e.authenticationEntryPoint(authenticationExceptionHandler)
.accessDeniedHandler(authorizationExceptionHandler))
.authorizeHttpRequests(auth
-> auth.requestMatchers(
"/v3/api-docs/**", "/swagger-ui/**", "/ejogajog/**")
.permitAll()
.requestMatchers(HttpMethod.OPTIONS, "/**")
.permitAll()
.requestMatchers(ALLOWED_URLS)
.permitAll()
.requestMatchers(DOWNLOAD_ALLOWED_URLS)
.permitAll()
.requestMatchers(ADMIN_ALLOWED_URLS)
.hasAuthority(UserRoleEnum.ADMIN.name())
.requestMatchers(ADMIN_ENTERPRISE_URLS)
.hasAuthority(UserRoleEnum.ADMIN.name())
.requestMatchers(COMMON_ALLOWED_URLS)
.hasAnyAuthority(UserRoleEnum.ADMIN.name(),
UserRoleEnum.DRIVER.name(),
UserRoleEnum.FLEETOWNER.name(),
UserRoleEnum.AGENT.name(), UserRoleEnum.CUSTOMER.name())
.requestMatchers(USER_ALLOWED_URLS)
.hasAnyAuthority(UserRoleEnum.DRIVER.name(),
UserRoleEnum.FLEETOWNER.name(),
UserRoleEnum.AGENT.name(), UserRoleEnum.CUSTOMER.name(),
UserRoleEnum.ADMIN.name())
.requestMatchers(DRIVER_ALLOWED_URLS)
.hasAuthority(UserRoleEnum.DRIVER.name())
.requestMatchers(FLEET_OWNER_ALLOWED_URLS)
.hasAuthority(UserRoleEnum.FLEETOWNER.name())
.requestMatchers(TRIP_URLS)
.hasAnyAuthority(UserRoleEnum.FLEETOWNER.name(),
UserRoleEnum.DRIVER.name(), UserRoleEnum.CUSTOMER.name())
.requestMatchers(CUSTOMER_URLS)
.hasAuthority(UserRoleEnum.CUSTOMER.name())
.requestMatchers(NOTIFICATION_URLS)
.hasAnyAuthority(UserRoleEnum.DRIVER.name(),
UserRoleEnum.FLEETOWNER.name(),
UserRoleEnum.AGENT.name(), UserRoleEnum.CUSTOMER.name())
.requestMatchers(ENTERPRISE_URLS)
.hasAnyAuthority(UserRoleEnum.CUSTOMER.name(),
UserRoleEnum.FLEETOWNER.name())
.anyRequest()
.authenticated());
// .addFilterBefore(jwtAuthenticationTokenFilter,
//UsernamePasswordAuthenticationFilter.class);
return http.build();
}
< /code>
2025-08-27T15:13:51.650+08:00 ERROR 4340 --- [nio-8080-exec-3] c.a.e.r.e.h.GlobalExceptionHandler : Server Error -
jakarta.servlet.ServletException: Handler dispatch failed: java.lang.StackOverflowError
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1104) ~[spring-webmvc-6.2.8.jar:6.2.8]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979) ~[spring-webmvc-6.2.8.jar:6.2.8]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) ~[spring-webmvc-6.2.8.jar:6.2.8]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903) ~[spring-webmvc-6.2.8.jar:6.2.8]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:564) ~[tomcat-embed-core-10.1.42.jar:6.0]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) ~[spring-webmvc-6.2.8.jar:6.2.8]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) ~[tomcat-embed-core-10.1.42.jar:6.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195) ~[tomcat-embed-core-10.1.42.jar:10.1.42]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.42.jar:10.1.42]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-10.1.42.jar:10.1.42]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.42.jar:10.1.42]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.42.jar:10.1.42]
at com.appster.ejogajog.rest.config.security.jwt.JwtAuthenticationTokenFilter.doFilter(JwtAuthenticationTokenFilter.java:93) ~[classes/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.42.jar:10.1.42]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.42.jar:10.1.42]
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:108) ~[spring-web-6.2.8.jar:6.2.8]
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:108) ~[spring-web-6.2.8.jar:6.2.8]
at org.springframework.security.web.FilterChainProxy.lambda$doFilterInternal$3(FilterChainProxy.java:231) ~[spring-security-web-6.5.1.jar:6.5.1]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:365) ~[spring-security-web-6.5.1.jar:6.5.1]
at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:101) ~[spring-security-web-6.5.1.jar:6.5.1]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.5.1.jar:6.5.1]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:125) ~[spring-security-web-6.5.1.jar:6.5.1]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119) ~[spring-security-web-6.5.1.jar:6.5.1]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.5.1.jar:6.5.1]
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100) ~[spring-security-web-6.5.1.jar:6.5.1]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.5.1.jar:6.5.1]
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:179) ~[spring-security-web-6.5.1.jar:6.5.1]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.5.1.jar:6.5.1]
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-6.5.1.jar:6.5.1]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.5.1.jar:6.5.1]
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:107) ~[spring-security-web-6.5.1.jar:6.5.1]
Подробнее здесь: https://stackoverflow.com/questions/797 ... napi-issue