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=changelogat 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)
Hi!
503 - Service Unavailable, does your service work from internet?
Cheers,
Gonchik Tsymzhitov
Yes, the same rest URL works on browser.
Well, let's reuse this client
https://bitbucket.org/atlassian/jira-rest-java-client
Thanks Gonchik for the information. I implemented the same using the client but I am still getting the same exception.
It looks like you're new here. Sign in or register to get started.