java.lang.IllegalStateException: InputStream has already been read - do not use InputStreamResource if a stream needs to be read multiple times

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Spring JIRA by Greg Adams, 1 year ago
InputStream has already been read - do not use InputStreamResource if a stream needs to be read multiple times
via Spring JIRA by Greg Adams, 1 year ago
InputStream has already been read - do not use InputStreamResource if a stream needs to be read multiple times
via Spring JIRA by Hal Hildebrand, 1 year ago
InputStream has already been read - do not use InputStreamResource if a stream needs to be read multiple times
via Spring JIRA by Hal Hildebrand, 1 year ago
InputStream has already been read - do not use InputStreamResource if a stream needs to be read multiple times
java.lang.IllegalStateException: InputStream has already been read - do not use InputStreamResource if a stream needs to be read multiple times
at org.springframework.http.converter.ResourceHttpMessageConverter.writeInternal(ResourceHttpMessageConverter.java:100)
at org.springframework.http.converter.ResourceHttpMessageConverter.writeInternal(ResourceHttpMessageConverter.java:47)
at org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:195)
at org.springframework.http.converter.FormHttpMessageConverter.writePart(FormHttpMessageConverter.java:349)
at org.springframework.http.converter.FormHttpMessageConverter.writeParts(FormHttpMessageConverter.java:329)
at org.springframework.http.converter.FormHttpMessageConverter.writeMultipart(FormHttpMessageConverter.java:318)
at org.springframework.http.converter.FormHttpMessageConverter.write(FormHttpMessageConverter.java:233)
at org.springframework.http.converter.FormHttpMessageConverter.write(FormHttpMessageConverter.java:88)

Users with the same issue

You are the first who have seen this exception.

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.