You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error is.. The returnType class java.lang.Object on public java.lang.Object xxxx.xxxx.xxxx.xxxx.controller.XXXController.something(kotlin.coroutines.Continuation) must return an instance of org.reactivestreams.Publisher (for example, a Mono or Flux) in order to support Reactor Context
But if I change the code like this, works fine.
@GetMapping("")
@ResponseStatus(HttpStatus.OK)
@PreAuthorize("hasRole('USER')")
fun something(): Mono<String> {
return Mono.just("Hello")
}
Expected behavior
When I use spring boot 3.0.1, that any codes works fine.
But after I upgrade to 3.0.4, kotlin coroutines not work.
The text was updated successfully, but these errors were encountered:
I thinks the 'invoke' method in org.springframework.security.authorization.method.AuthorizationManagerBeforeReactiveMethodInterceptor should allow coroutine suspend function.
@Override
public Object invoke(MethodInvocation mi) throws Throwable {
Method method = mi.getMethod();
Class<?> type = method.getReturnType();
Assert.state(Publisher.class.isAssignableFrom(type),
() -> String.format("The returnType %s on %s must return an instance of org.reactivestreams.Publisher "
+ "(for example, a Mono or Flux) in order to support Reactor Context", type, method));
Describe the bug
I faced an error after upgrade spring boot from 3.0.1 to 3.0.4 on @PreAuthorize("hasRole('USER'").
To Reproduce
Error is..
The returnType class java.lang.Object on public java.lang.Object xxxx.xxxx.xxxx.xxxx.controller.XXXController.something(kotlin.coroutines.Continuation) must return an instance of org.reactivestreams.Publisher (for example, a Mono or Flux) in order to support Reactor Context
But if I change the code like this, works fine.
Expected behavior
When I use spring boot 3.0.1, that any codes works fine.
But after I upgrade to 3.0.4, kotlin coroutines not work.
The text was updated successfully, but these errors were encountered: