java.lang.IllegalStateException

InputStream has already been read - do not use InputStreamResource if a stream needs to be read multiple times

Solutions on the web32440

  • via Spring JIRA by Greg Adams, 11 months 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, 11 months ago
    InputStream has already been read - do not use InputStreamResource if a stream needs to be read multiple times
  • Stack trace

    • java.lang.IllegalStateException: InputStream has already been read - do not use InputStreamResource if a stream needs to be read multiple times at org.springframework.core.io.InputStreamResource.getInputStream(InputStreamResource.java:96)[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.http.converter.ResourceHttpMessageConverter.writeInternal(ResourceHttpMessageConverter.java:100)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.http.converter.ResourceHttpMessageConverter.writeInternal(ResourceHttpMessageConverter.java:47)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:195)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.http.converter.FormHttpMessageConverter.writePart(FormHttpMessageConverter.java:349)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.http.converter.FormHttpMessageConverter.writeParts(FormHttpMessageConverter.java:329)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.http.converter.FormHttpMessageConverter.writeMultipart(FormHttpMessageConverter.java:318)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.http.converter.FormHttpMessageConverter.write(FormHttpMessageConverter.java:233)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.http.converter.FormHttpMessageConverter.write(FormHttpMessageConverter.java:88)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:800)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You are the first who have seen this exception. Write a tip to help other users and build your expert profile.