Skip to content

@Async is defaulting to RequestHandlerMapping #34753

@orubel

Description

@orubel

Am running spirngboot 3.2.5 with JDK 21 and when I add a Completeablefuture and @async to an endpoint mapped with SimpleUrlHandlerMapping, the DispatcherServlet is trying to use RequestHandlerMapping.

Now I know that this is supposed to work with webflux and see nothing that says 'async' requires RequestHandlerMapping. This seems to be a 'bug' (but I have been wrong before)

12:50:17.346 [http-nio-127.0.0.1-auto-1-exec-4] DEBUG o.s.security.web.FilterChainProxy - Secured GET /v1.0/user/show
12:50:17.347 [http-nio-127.0.0.1-auto-1-exec-4] DEBUG o.s.web.servlet.DispatcherServlet - GET "/v1.0/user/show", parameters={}
12:50:17.347 [http-nio-127.0.0.1-auto-1-exec-4] WARN  o.s.web.servlet.PageNotFound - No mapping for GET /v1.0/user/show
12:50:17.347 [http-nio-127.0.0.1-auto-1-exec-4] DEBUG o.s.web.servlet.DispatcherServlet - Completed 404 NOT_FOUND
12:50:17.350 [http-nio-127.0.0.1-auto-1-exec-4] DEBUG o.s.security.web.FilterChainProxy - Securing GET /error
12:50:17.351 [http-nio-127.0.0.1-auto-1-exec-4] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped to io.beapi.api.controller.BeapiErrorController#error(HttpServletRequest, HttpServletResponse)
12:50:17.351 [http-nio-127.0.0.1-auto-1-exec-4] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped to io.beapi.api.controller.BeapiErrorController#error(HttpServletRequest, HttpServletResponse)
12:50:17.352 [http-nio-127.0.0.1-auto-1-exec-4] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped to io.beapi.api.controller.BeapiErrorController#error(HttpServletRequest, HttpServletResponse)
12:50:17.352 [http-nio-127.0.0.1-auto-1-exec-4] DEBUG o.s.security.web.FilterChainProxy - Secured GET /error
12:50:17.352 [http-nio-127.0.0.1-auto-1-exec-4] DEBUG o.s.web.servlet.DispatcherServlet - "ERROR" dispatch for GET "/error", parameters={}
12:50:17.352 [http-nio-127.0.0.1-auto-1-exec-4] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped to io.beapi.api.controller.BeapiErrorController#error(HttpServletRequest, HttpServletResponse)

This DOESN"T affect the other endpoints that are also mapped with SimpleUrlHandlerMapping; only the one I added 'async' to.

It is also making it past initial filters (JwtRequestFilter, RequestInitializationFilter) and are not throwing an error BUT is not making it to the interceptor.

Thus I can assume that something in the securityfilterchain is causing this issue. Should I move this bug to spring-security????

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions