Spring RestClient returns an error when sending a MultipartFile "No serializer found for class sun.nio.ch.ChannelInputStream" #33726
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: waiting-for-feedback
We need additional information before we can continue
status: waiting-for-triage
An issue we've not yet triaged or decided on
I try send request via RestClient:
I get an error
"Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException:No serializer found for class sun.nio.ch.ChannelInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.springframework.http.HttpEntity["body"]->org.springframework.util.LinkedMultiValueMap["file"]->java.util.ArrayList[0]->org.springframework.web.multipart.MultipartFileResource["inputStream"])"
Spring Boot version 3.3.2
I found solve for RestTemplate:
How to send Multipart form data with restTemplate Spring-mvc - it work only for RestTemplate and not RestClient
The text was updated successfully, but these errors were encountered: