Calling REST API to connect JIRA from Java has issues


Today i have created . I tried REST API call from the browser and able to get the JSON response.   The URL tried in the browser :

However in From Java Program i'm not able to connect to Tried InetAddress.getByName("") . It throws

Could you please help to resolve this issue, so that i can proceed further to make rest call from java program.





3 answers

Are you behind an HTTP proxy?

Yes, i'm behind proxy. Not sure why it is working from browser and not from Java program. 

Also when i ping from command prompt. It says couldn't find host. 

That's normal for corporate IT policies - your DNS access is restricted.

This works from the browser, because the browser is configured to go though an HTTP proxy (which does the actual name resolution). To make this work in Java you need to configure the same HTTP proxy as in the browser. You can do this from command line or set it programmatically - see here. Another option is to set it directly on the HTTP client you are using to make the HTTP request - check its documentation.


Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 14 hours ago in Jira Service Desk

Looking for anyone who has switched from Zendesk to Jira Service Desk

Hi Community! The Jira Service Desk marketing team is looking for customers who have successfully switched from Zendesk to Jira Service Desk!   We’d love to hear your thoughts on the pros and ...

18 views 0 1
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you