Search code examples
spring-bootexceptionjackson-databindbytearrayinputstream

ByteArrayInputStream throwing exception : No Serializer found for class java.io.ByteArrayInputStream


Current Code

Tried adding properties in application.properties

Application.properties

Added Bean for Object Mapper

Exception Tried a million times to find out the root cause of the issue but still I'm not able to find the solution

It is throwing exception as attached .

Anyone able to find a fix ?


Solution

  • We would need more code, for example, the MockMultipartFile and also the complete flow of data. Still, I will guess that you have an InputStream in your MockMultipartFile. If that is the case, try to replace that with byte[].