YAZONG 我的开源

springboot-admin启动后的控制台错误(BodyExtractors$ReadCancellationException: null)(Async state [MUST_DISPATCH])

 
0 评论0 浏览

在springboot-admin启动后,控制台一直不停输出下述异常,问题如下:

2019-06-20 10:47:58.614 WARN 1429 — [reactor-http-client-epoll-8] d.c.b.a.s.s.EndpointDetectionTrigger : Unexpected error while handling PooledSlicedByteBuf(ridx: 0, widx: 129, cap: 129/129, unwrapped: PooledUnsafeDirectByteBuf(ridx: 451, widx: 456, cap: 1024))
org.springframework.web.reactive.function.BodyExtractors$ReadCancellationException: null

2019-06-20 10:57:40.107 ERROR 1429 — [http-nio-8760-exec-8] o.a.catalina.connector.CoyoteAdapter : Exception while processing an asynchronous request
java.lang.IllegalStateException: Calling [asyncError()] is not valid for a request with Async state [MUST_DISPATCH]

此项目集成了springbootadmin,后台启动后一直报上述错误,刚开始一直以为是核心配置文件问题,没注意到版本号,刚开始的版本号为:

<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.1.0.RELEASE</version>
	<relativePath/>
</parent>

<dependency>
	<groupId>de.codecentric</groupId>
	<artifactId>spring-boot-admin-starter-server</artifactId>
	<version>2.1.1</version>
</dependency>

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dependencies</artifactId>
			<version>Finchley.RELEASE</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

修改版本号为下述内容即可(springcloud不用动):

<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.0.6.RELEASE</version>
	<relativePath/>
</parent>

<dependency>
	<groupId>de.codecentric</groupId>
	<artifactId>spring-boot-admin-starter-server</artifactId>
	<version>2.0.6</version>
</dependency>

从这个问题引发的启发,由于springbootadmin读取了eureka的内容,而且这里集成了Springcloud,无论是哪个工程,版本号都最好对应一致。

springboot2.1.X和springboot2.0.X有一些改变,升级的时候会不可避免的引发一些问题,所以版本号还是对应一致比较靠谱。

在GITHUB找到的一个相似问题“https://github.com/spring-projects/spring-boot/issues/15057”,从而引发了上述的解决方案和思考。


标题:springboot-admin启动后的控制台错误(BodyExtractors$ReadCancellationException: null)(Async state [MUST_DISPATCH])
作者:yazong
地址:https://blog.llyweb.com/articles/2019/06/20/1578150901667.html