I am using RestTemplate class to post a document to an endpoint. But I encounter with this error:
org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 Internal Server Error: [no body]
It works for the other documents which are smaller than 7 MB. Here is the relevant part:
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.setAccept(Collections.singletonList(MediaType.valueOf(MediaType.APPLICATION_JSON_UTF8_VALUE)));
headers.setBearerAuth(this.getAccessToken());
HttpEntity<String> body = CommunicationUtil.getHttpBody(headers, document);
ResponseEntity<String>responseEntity = restTemplate.exchange(api.getApiClient().getBasePath() + "/myPostEndpoint", HttpMethod.POST,
body, String.class);
return responseEntity.getStatusCode();
The error appears after the exchange() method. Is there any file upload limit? Because I could not find any.
I am making this call inside a Liferay application with Tomcat.