0

I am trying to access a static json using getForObject method. It worked fine for 14 hours and then started throwing 400 Bad Request. After another 24 hours, it started to throw UnsupportedHttpStatusCodeException [494] null.

We use aws ec2 instance for hosting our application. The issue occurs around 14 hours after the deployment and disappears after redeploying the application to just reappear after another 14 hours. My client class has the below code.

public void getData(String apiUrl){
    try{
       LOGGER.info( "Using restTemplate getForObject" );
       Data response = restTemplate.getForObject( apiUrl, Data.class );
       LOGGER.info( "Response {}", response );
    }catch ( RestClientException e ){
       LOGGER.error( "Exception while getForObject : {}", e );
    }
}

0 Answers0