I am new to JIRA and using JIRA REST API to fetch issue from the remote host. I wrote a simple program to fetch the issue according to this tutorial following is the code
public class JIRAClient
{
public static void main(String[] args) throws URISyntaxException {
final JerseyJiraRestClientFactory factory = new JerseyJiraRestClientFactory();
final URI jiraServerUri = new URI("http://jira.companyname.net:8080/jira/");
final JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, "abc", "xyz");
final NullProgressMonitor pm = new NullProgressMonitor();
final Issue issue = restClient.getIssueClient().getIssue("RRT-123456", pm);//<--line 24
System.out.println(issue);
}
with this exception
Exception in thread "main" com.atlassian.jira.rest.client.RestClientException: com.sun.jersey.api.client.UniformInterfaceException: Client response status: 404
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:70)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.getAndParse(AbstractJerseyRestClient.java:80)
at com.atlassian.jira.rest.client.internal.jersey.JerseyIssueRestClient.getIssue(JerseyIssueRestClient.java:145)
at com.atlassian.jira.rest.client.internal.jersey.JerseyIssueRestClient.getIssue(JerseyIssueRestClient.java:136)
at client.JIRAClient.main(JIRAClient.java:24)
Caused by: com.sun.jersey.api.client.UniformInterfaceException: Client response status: 404
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:676)
at com.sun.jersey.api.client.WebResource.get(WebResource.java:191)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient$1.call(AbstractJerseyRestClient.java:84)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:54)
... 4 more
For the record I'm using **cisco vpn**
to connect to the host(otherwise it gives UnknownHostException) also I installed m2e plugin and created a maven project.
What would be the cause of the exception?. Am I using the wrong URL or should I try using another authentication method?.