因为我试图在maven中从spring-webflux中更新spring-boot-starter-webflux依赖项。我的工作代码开始出现错误,比如“
发自:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>改为:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webflux</artifactId>
<version>5.2.6.RELEASE</version>
</dependency>出现以下错误:
org.springframework.web.reactive.function.UnsupportedMediaTypeException: Content type 'application/json' not supported for bodyType=com.location.of.Object at org.springframework.web.reactive.function.BodyInserters.unsupportedError(BodyInserters.java:391)注意:,我正在为POJO尝试库,其中包含构造函数。有什么问题吗?如何解决这个问题?
发布于 2020-05-31 16:43:06
这是因为缺少Jeckson依赖关系,而我没有将其包含在项目的子模块中。我在子模块中添加了依赖项,它起了作用。谢谢大家。
https://stackoverflow.com/questions/62046883
复制相似问题