Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting HTTP Error 503 while accessing JIRA Rest API

Amandeep Singh October 23, 2018

Hi

I am getting the following exception while connecting to JIRA rest API on line in bold

URL - http://jira.amadeusri.com/rest/api/2/issue/ARI-20092?expand=changelog

Code - 

URL _url = new URL("<JIRA URL>" +"rest/api/2/issue/" + id +"?expand=changelog");
String _json = webRequest.getUrl( _url,"xxxx","xxxx");



getURL method in WebRequest.java

URLConnection _urlConnection = url.openConnection();
_urlConnection.setConnectTimeout(10 * 60 * 1000);
_urlConnection.setReadTimeout(10 * 60 * 1000);

if (username != null && !username.isEmpty()) {
String _authStringEnc = new String(
Base64.encodeBase64(
(username + ":" + password).getBytes()
)
);
System.out.println("Auth: " + _authStringEnc);

_urlConnection.setRequestProperty("Authorization", "Basic " + _authStringEnc);
System.out.println(_urlConnection.getContentType());
}

String _ret = IOUtils.toString(_urlConnection.getInputStream());
System.out.println("Returned " + _ret.length() + " chars");

return _ret;


 

java.io.IOException: Server returned HTTP response code: 503 for URL: http://jira.amadeusri.com/rest/api/2/issue/ARI-20092?expand=changelog
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1944)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1939)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1938)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1508)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at com.amadeus.ri.jiradatapull.utility.WebRequest.getUrl(WebRequest.java:45)
at com.amadeus.ri.jiradatapull.impl.JiraDataPullEngineImpl.get(JiraDataPullEngineImpl.java:37)
at com.amadeus.ri.jiradatapull.app.JiraDataPullEngineApp.main(JiraDataPullEngineApp.java:15)

1 answer

0 votes
Gonchik Tsymzhitov
Community Champion
October 23, 2018

Hi! 

 

503 - Service Unavailable, does your service work from internet? 

 

Cheers,

Gonchik Tsymzhitov

Amandeep Singh October 23, 2018

Yes, the same rest URL works on browser.

Gonchik Tsymzhitov
Community Champion
October 23, 2018
Amandeep Singh October 23, 2018

Thanks Gonchik for the information. I implemented the same using the client but I am still getting the same exception.

Amandeep Singh October 29, 2018

@Gonchik Tsymzhitov - Can you please help. This is something which I tried -

Installed JIRA trail version on my local. When I try to access that JIRA it works but when I try to access company's JIRA, I get an Error 503. Another observation - JIRA client on my local using HTTP while the organisation using HTTPS. 

Really looking forward to your response.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events