New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CannotGetJdbcConnectionException in Spring Boot if I use a suspend function in @RestController #21431
Comments
Thanks for the report. There are two parts to it. The first is somewhat similar to spring-projects/spring-framework#25050. It's not clear from the output shared above, but I think this is being reported by The second is that the suspending handler method has been identified as one that is unsupported. The stack suggests that you are using Spring MVC rather than Spring WebFlux which contradicts the dependencies you've listed. So that we can be certain of what's happening in your app, can you please provide a minimal sample that reproduces the problem you have described? You can do so by zipping it up and attaching it to this issue or by pushing it to a separate repository on GitHub. |
Thanks! It's in the sbsuspend-branch: https://github.com/MikeMitterer/kotlin-catshostel-sb/tree/sbsuspend |
Thanks for the link to the app. As suspected, the problem is that you are using Spring MVC rather than Spring WebFlux. Unlike WebFlux, MVC does not support suspending handler methods. You are using MVC because of your dependency on WebFlux's WebSocket support (part of the If you have any further questions, please follow up on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. |
My RestController has this function:
My dependencies are:
[Update]
If I call the "wait"-API-FunctionIf I start the server
I get
The text was updated successfully, but these errors were encountered: