Calling [asyncError()] is not valid for a request with Async state [MUST_DISPATCH]

 ̄綄美尐妖づ 提交于 2019-12-04 23:11:11

Try to switch on JETTY, it has helped me.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <exclusions>
        <exclusion>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <groupId>org.springframework.boot</groupId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jetty</artifactId>
</dependency>

SBA-UI is using some long polling, when the browser closes the connection and the server tries to write some data on it the above exception is logged. All of it is quite normal. It shouldn't affect the application. For more infformation: https://github.com/spring-projects/spring-boot/issues/15057

Actually there is a simple solution: Just don't use the Tomcat servlet container but run the admin server in a reactive setup, like:

@SpringBootApplication
@EnableAdminServer
public class AdminServer {
    public static void main(String[] args) {
        new SpringApplicationBuilder(AdminServer.class)
        .web(WebApplicationType.REACTIVE)
        .run(args);
    }
}

This way I don't get any errors.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!