我是 JIRA 新手,使用 JIRA REST API 从远程主机获取问题。我根据本教程编写了一个简单的程序来获取问题 以下是代码
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);
}
除了这个例外
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
对于我**cisco vpn**
用来连接到主机的记录(否则它会给出 UnknownHostException),我还安装了m2e插件并创建了一个 maven 项目。
异常的原因是什么?我使用了错误的 URL 还是应该尝试使用其他身份验证方法?