测试积点老人 发表于 2021-11-11 11:10:28

SpringBoot微服务项目,一个微服务调用另一个微服务的feign传文件时报错。

用postman测试一个接口,这个接口调用另一个微服务的feign接口上传文件时,出现
feign.codec.EncodeException: Type definition error: ; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.springframework.web.multipart.support.StandardMultipartHttpServletRequest$StandardMultipartFile["inputStream"]->java.io.FileInputStream["fd"])错误

然后在PostMapping处添加consumes = MediaType.MULTIPART_FORM_DATA_VALUE,又出现
feign.codec.EncodeException: Could not write request: no suitable HttpMessageConverter found for request type and content type .这个应该怎么解决?

qqq911 发表于 2021-11-12 10:26:35

检查下环境

海海豚 发表于 2021-11-12 11:22:36

https://blog.csdn.net/Mou_O/article/details/104650209/参考这个

jingzizx 发表于 2021-11-12 15:48:08

需要传值把
页: [1]
查看完整版本: SpringBoot微服务项目,一个微服务调用另一个微服务的feign传文件时报错。