Spring Boot 3 Invalid return type for async method (only Future and void supported): class java.lang.Boolean
Spring Boot About 291 words错误信息
Invalid return type for async method (only Future and void supported): class java.lang.Boolean
错误原因
@Async
标注的方法,返回值设置为了Boolean
。
解决方法
将返回值改为void
或Future
。
@Async
public Future<Boolean> asyncTask() {
// TODO asyncTask
return CompletableFuture.completedFuture(Boolean.TRUE);
}
Views: 1,037 · Posted: 2024-03-20
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb/LiteNote扫描下方二维码关注公众号和小程序↓↓↓
Loading...