简体   繁体   中英

Getting error UnsupportedMediaTypeException when trying to update maven dependency to spring-webflux from spring-boot-starter-webflux

As I am trying to update spring-webflux dependency from spring-boot-starter-webflux in maven. My working code start giving error like"

From:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-webflux</artifactId>
    <version>2.2.6.RELEASE</version>
</dependency>

changed to:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webflux</artifactId>
    <version>5.2.6.RELEASE</version>
</dependency>

Getting below Error:

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)

Note: I am trying Jackson library for POJO and having constructor in that. What could be issue? How to solve it?

It is because of missing Jeckson dependency which I have't included in my project's submodule. I added the dependency in child module and it worked. Thanks all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM